|
Posted by Manuel Lemos on 03/18/07 05:24
on 03/16/2007 08:57 PM Kentor said the following:
> Hello,
>
> I've been trying to find a way to reduce a given file with PHP... What
> I want to do is once a user uploads images, I want to have 2 copies of
> this image: 1 with the original size and one 1 with a small size so
> that when many listings appear on the page, the user will see all
> these images but he will see them in a small version of the real size,
> so instead of resizing the image's width and height, it would be
> better to resize the file size and make it smaller so that it
> downloads faster. If he clicks on the add to view the images in large
> format then I would show the images in the original size and this file
> would be bigger... The resized image should not lose its quality
> since it will be small so it won't be noticeable... I've tried this
> script here: http://www.phpclasses.org/browse/package/1980.html but it
> doesn't do anything at all =/
That class does what you want for JPEG pictures. It takes a target file
size and tries to find the JPEG compression factor that the image should
be saved to not exceed the given target size.
--
Regards,
Manuel Lemos
Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
[Back to original message]
|