zenphoto forums » General Zenphoto Discussion

Caching of image occurs, although not needed

(7 posts)
  1. jackdaw

    Contributor
    Joined: May '08
    Posts: 319

    Not a good description :) but this is what I get:

    1. I use printDefaultSizedImage to display the image
    2. I upload only images that are 600px longest side
    3. I set upscaling to none
    4. I set max image size longest side also to 600px for galley and albums
    5. I set image quality to 100 for the large/middle size (although I don't have/want a middle size) and the thumbs to quality 70.

    Now I can see that although the images are 600px and 50kb in size when uploaded, in the cache folder there appears a cached image of 600px, 140kb in size!

    Three years ago I had this problem. Have I forgotten something?

    http://www.zenphoto.org/support/topic.php?id=2985

    Posted 1 year ago #
  2. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,768

    Sure, so you want us to not cache the image if the size is already the needed size, etc.? In fact once-upon-a-time this was what did happen.

    But there is a serious problem with that strategy. Caching an image happens only once per "size" and takes some disk space. Testing to see if the image should be cached happens every time the image is referenced for display in any way. So the trade-off is storage space vs. processing overhead. With the cost of disk so low these days the choice is a no-brainer.

    Don't forget to read the Forum rules and usage resources
    Posted 1 year ago #
  3. jackdaw

    Contributor
    Joined: May '08
    Posts: 319

    Ok, but what happens with the quality? When I upload a 600px 50kb image, and it is cached as a 600px 150kb image, that's no good for speed, is it? And if I set the image size to jpg 70, then my already reduced quality jpegs are again reduced with quality setting 70, making all my photoshop work useless.

    Posted 1 year ago #
  4. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,768

    If you do not like the quality of the GD library processing then you should use Imagick.

    Don't forget to read the Forum rules and usage resources
    Posted 1 year ago #
  5. jackdaw

    Contributor
    Joined: May '08
    Posts: 319

    The quality is good, when uploading a larger image that has to be brought back to a desired size and set to a jpg quality of 70. No complaints there. But why transforming a perfect image of 600px into another 600px copy of 'lesser' quality?

    I'm just trying to be logical about this. It's not about disk space. A simple solution would be if there would be an option in the admin panel where users can set the image quality of the uploaded image to 1. using the slider for the desired quality, or 2. don't use the slider and use uploaded image instead.

    You see, I don't use a 'middle' image. I only use a thumbnail that points to the 600px image.

    Posted 1 year ago #
  6. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,355

    Sbillard actually explained why sized images are always processed. It is a technical and performance issues.
    Zenphoto has three types of images in a standard theme:
    1. thumbnails
    2. sized images (the ones on image.php single display)
    3. full image (in standard themes opened via Colorbox for example).

    There is no "middle" image actually.

    So if you don't want the image on image.php without processing and the images have already the correct size you alway can change your theme to call the full image directly instead.

    Don't forget to read the Forum rules and usage resources
    Posted 1 year ago #
  7. jackdaw

    Contributor
    Joined: May '08
    Posts: 319

    Ah, thanks! :) Now I only have thumbs in my cache folders :).

    <?php $fullimage = getFullImageURL(); $fullimagetitle = getImageTitle(); echo "<img src=\"" . $fullimage . "\" title=\"" . $fullimagetitle . "\">"; ?>

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.