Hi,
I have noticed the rename command will change the jpg file ext to png and the I'll be able to view the png properly.
Is it true that rename will change the file type by converting it from jpg, bmp, gif, etc to PNG?
Thanks,
Jassim
Hi,
I have noticed the rename command will change the jpg file ext to png and the I'll be able to view the png properly.
Is it true that rename will change the file type by converting it from jpg, bmp, gif, etc to PNG?
Thanks,
Jassim
No. You are probably able to view it because the image itself contains a header from which the format is determined by whatever you used to view it, perhaps after it discovered that the image is not actually in PNG format.
then what's the best way to save ANY image to PNG? can I use imagepng() for that?
imagepng() is to save a PNG image. So if you want to save an image as a PNG then....
Of course, you'll need to combine it with imagecreatefromjpeg|string to create the image resource you'll want to pass to imagepng().