Recognizing File Formats
Posted: 2010-05-20T01:56:13-07:00
Hi
I have just a simple question I hope, but I couldn't find any answer on this question. If I use this command in PHP:
exec("convert filename.fileending -resize 200x200 filename.fileending);
but with different files (eg. .jpg / .gif / .png / .txt / .pdf / .doc / .xml..........)
Will ImageMagick actually only make changes on the typical image files (.jpg/.gif/.png...) or am I at risk that certain other filetypes get modified too? I am specially worried that weird things are happening, like that somebody uploads an Excel Sheet and it becomes corrupted.....
Do I need to check my filetype in PHP first or can I just let the command loose and ImageMagick ignores the non-image files?
Thanks!
I have just a simple question I hope, but I couldn't find any answer on this question. If I use this command in PHP:
exec("convert filename.fileending -resize 200x200 filename.fileending);
but with different files (eg. .jpg / .gif / .png / .txt / .pdf / .doc / .xml..........)
Will ImageMagick actually only make changes on the typical image files (.jpg/.gif/.png...) or am I at risk that certain other filetypes get modified too? I am specially worried that weird things are happening, like that somebody uploads an Excel Sheet and it becomes corrupted.....
Do I need to check my filetype in PHP first or can I just let the command loose and ImageMagick ignores the non-image files?
Thanks!