how to make thumbnail from a .swf in php? - php

I have to make thumbnails from banners in swf file format (flash 9). I want to use php, but if that's not possible anything which work in a linux command line is fine by me.
I tried to open them with ffmpeg-php, but it says: Can't open movie file /where/the/file/is
The file is there and is readable by the user.
Any ideas?

Related

Download a torrent with php

I want to download a torrent using php.
So the scenario is that the user uploads a torrent and the server downloads it.
Than the user can download the torrent using his browser.
Dont know if this is the right way for you but:
Install rtorrent (https://wiki.archlinux.org/index.php/RTorrent)
configure rtorrent to watch a direcory for new torrent-files (http://jkt.im/2011/09/28/automatic-torrent-management-with-rtorrent-and-some-helper-scripts/)
rtorrent will download the files and move it into a directory like "done"
php script checks the folder vor new content and convert / show the files online in webpage
All the functionality you need already exist with rTWi http://rtwi.jmk.hu/ and its also open source so all you need is little customization

mpdf generates pdf without images

I use mpdf for a php project but I am having difficulties generating pdf file with images. it displays the pdf file correctly on browsers but after I save the pdf file it doesnt display the images. I tried it with different browsers/OS and the result is little bit strange to me. it works on very browser and displays local pdf file correctly on linux machine. mac and windows it displays images on every browser but when I save the pdf file it doesnt display the images on local pdf. do you have any idea how to solve this problem.
Thanks
you have to use absolute linking, starting all the way at the top with the domain name.

Flash/PHP: Using the AS3 Jpeg Encoder

I am a beginner at both Actionscript3 and PHP, and I'm trying to get Henry Jone's movie clip to jpeg code to work for me, as seen here:
http://henryjones.us/articles/using-the-as3-jpeg-encoder
I downloaded the source and then uploaded the .swf and the .php in the same directory. However, when I click "download your sketch," it downloads the .php file instead of a jpeg.
The .swf I uploaded can be seen here:
http://www.snut.org/storage/scrntest/sketch.swf
I didn't change any of the code from the source I downloaded, so I can't figure our what the problem is. Can anyone help?
Rule of thumb - any time your web server downloads .php files instead of rendering the output of the file it is a good sign that your server isn't set up to handle PHP. You need to tell Apache to use PHP, google around for "install PHP on Apache web server" and that should get you started.
Basically .php files are just text files, so unless you have something telling your web server to treat .php files different from normal text files then it'll just assume the user wants to download the file that's being linked.

PHP: How to get shockwave .dcr file width and the height?

As we know the function getimagesize() works very good for images and swf files.
But it doesn't support shockwave file (.dcr).
SO, how can I get the width and the height of such file..
I am not Lingo/Director expert, but AFAIK you won't be able to do this from PHP.
.DCR file format is not open so you won't find file format specification for you to make your own parser and extract that info on your own.
However, there should be way to do this using director movie on client side.
Eg. You load external dcr file inside your own director movie (then you will be able to read width/height etc of loaded file). Your own director movie then updates some database with info on that specific loaded file so you can show width/height later on.
I've found this artice dating back to 2006 where this guy suggests the same thing:
http://director-online.com/forums/read.php?1,20621,20621,quote=1
Good luck mate! :)
If you have a windows server, you could install IrfanView (free) and use it from the command line (yes, it's free and has a command line) to convert the swf to dcr. (Surely there is a similar tool for Linux).
Convert images on the command line with IfranView
To call OS command line from php, use shell_exec().
Then you could read the swf image size with php normally.
Hope this helps

Downloading pdf files from a website and changing the filename after download

I am trying to download some files. I have written a php script that can gather all of the address of the pdf files I need to download into a array but the file names on that server are odd. How does one go about downloading pdf files with php?
you can try (if I understand your question correctly)
file_put_contents('/your/file/name.pdf',
file_get_contents('http://www.example.com/oddFile.pdf'))
Check out the file or file_get_contents functions. It can take URLs as well as local filenames.
http://www.php.net/manual/en/function.file.php
http://www.php.net/manual/en/function.file-get-contents.php

Categories