Best way to add image to mp3 file with PHP? - php

I am looking for a way to embed album art in a mp3 file with PHP, either through a some kind of PHP script or through exec() and a Linux command.

PHP supports setting ID3 tags, but it looks like it does not support images.
If you want to add image you can make use of the eyeD3 Linux command with --add-image option.

Related

how can I convert mp3 to wav using php code without external library or application

I am trying to generate waveform for mp3 files, and found that it is possible using php code to generate waveform for wav files, but not mp3. I need to convert mp3 to wav, but also it is not possible to install ffmpeg or lame on shared hosting, is there any other solutions like php based conversion?
I don't think this is possible. But you can use a SAAS platform to help you with that. maybe you can try http://www.encoding.com/ or http://aws.amazon.com/elastictranscoder/.

how to export pdf to another pdf without images

i'm develop a php application and i need to save a pdf to another pdf but without the images. I need only text of my original pfd. is Possible to do it in php on linux server? I try with pdfbox, but is impossible do it with command line. There are other solutions?
Unless you want text reflow, cpdf is free for non-commercial use.

How to extract icon from executable using PHP?

I need to extract the icon (.ico file) out of an executable (.exe).
I need it for PHP on Windows. Any Ideas?
I originally thought that ImageMagick will extract icons from .exe files. However, it seems my memory is failing me.
Instead, since you are prepared to accept the use of exec I think the quickest and easiest solution will be to use a tool like ResHacker. The can be driven in command-line mode. Then if you need to convert from .ico to .png, as per your last question, you can reach for ImageMagick.

Pdf on web page: best solution

I need to include pdf files in some webpages, and I'm gettin' in troubles.
The app is a simple newspaper's archive, in which i can read right on page or download as pdf files, one file per page. What my customer can provide me is one pdf file for each page; what my customer wants from me is to navigate them in indexes (with page thumbnail) and have a read from a choosen one direcly in page; I'm using php/mysql.
I started trying out to use the <object> tag with type="application/pdf", but i found it's deprecate 'cause it's not crossplatform at all (there's no support on linux's browsers, but even my windows' firefox 3.5 couldn't show me anything).
I guessed I could transform that pdf in something different (html or simply images are good enough), but the only thing i found is ImageMagick, that I cannot use as I must install on server and I can't, as I'm not admin of that machine.
So, I'm finally looking for suggestions
Thanks
Display the pdf inline using an IFRAME. The thumbnail you can generate with imageMagik. You should be able to use the command line version of ImageMagik to resize and convert to jpg.
edit
Your best bet is to talk to the server admin and have them install php support for ImageMagik then you can use it as a class.
If you can't get support to install on the server, you will have to use the command line version.
You might be able to Google around for a library that wraps the command line, but it would be trivial to write it yourself.
With this in place you can create a large readable black and white png for each page. It should click through to the pdf.

Options for using ImageMagick from PHP with MySQL blobs?

So my host provides ImageMagick on the server, but no MagickWand or IMagick API for PHP. I can do operations with the PHP exec command to manipulate images. But that requires full path file names to work, and I want to pull my images from my MySQL database. Will I have to have pull them out of the database and put them to a file everytime I want to do this? Any recommendations?
One option is to run the imagemagick process using proc_open() and write/read to/from the created process' stdin/stdout.
To have imagemagick read from stdin, you just give a dash '-' as input file. Specify /dev/stdout as the output file. Your call to image magick should look something like:
convert -scale 150x100 - /dev/stdout
Use fwrite and fread on the pipes created by proc_open to write input to imagemagick and read output back.
I haven't tried it, but I guess this should work.
If the only ImageMagick available to you can only operate on files (which is how I read your first sentence), then you will indeed have to make files from your MySQL blobs to use ImageMagick on them (and remember to clean things up afterwards). My recommendation might be to switch to a better hosting service, but I assume you have your reasons to stay with that one.
have you tried phMagick ?

Categories