Hi there, I have a community where users can upload personal avatars. Most images work fine (i accept .gif and .jpg/jpeg). My function resizes the uploaded avatar to 2 different sizes, and saves in a directory these 2 new files. However, there are images that for some reason are not accepted. I don't know why. Usually that happens with .jpg files. The only thing that makes them work, is if I save them as (through Photoshop) .gif, and then upload. Anyone has this problem? Also, if anyone has a very neat class for image handling (uploading, resizing, watermarking), or any links to really great and useful tutorials - i would appreciate it
hi Philopoemen, what does your actual function look like, and what is the error message, it's hard to tell what the problem is when this info is missing. Anyway, have you taken a look at PEAR? It offers standard library for common functions, including the resize function for images: For example, with the PEAR package Image_Transform installed: <?php require_once 'Image/Transform.php'; $i =& Image_Transform::factory(''); $i->load('test.jpg'); $i->fit(100,100); $i->save('resized.png', 'png'); ?> PHP: I am using this and have never had a problem, i am doing the same thing, saving it twice in a dir, one thumbnail, one original. For the uploading, i would recommend the PEAR package HTTP_Upload. http://pear.php.net/package/Image_Transform http://pear.php.net/package/HTTP_Upload
Maybe problem is in extension, maybe it parse only jpg files, and not files, that finish jpeg. I had same problem once, and had to modifuy some files.