No image processing besides thumbnail generation needed

It there a way/option to disable the image processing besides the thumbnail generation? All of my pictures have already watermarks and their x/y dimensions are also perfect. The further processing via `i.php` decreases the image quality or leads to larger file sized pictures. Instead of this not needed image processing I would like to have just an ordinary copy into the cache folder. Currently I have to add the suffix "_595.jpg" to each file and copy it into the cache by myself (via ftp), to avoid this negative behavior. This takes a lot of time, since I have hunderts of pictures. It's also very risky, because if I clear the cache in the admin panel by accident all my work would be gone/lost...

TIA
Steffen

Comments

  • acrylian Administrator, Developer
    Just upload fullsize images in exact that size (or a little smaller) you need in your theme and set the size to that in the option, then zp should only process the thumbs and take the uploaded image as the sized image.
  • The image in the cache folder is different from the image in albums folder, even if I set the parameter "image size" in the admin options to the image size of the picture (e.g. option: 500px, image: 500x333). To be sure not using an old already cached picture, I pressed the button "Pre-cache images" with clear enable before. The cached picture is definitely processed via i.php, its size is different from the original. If I look into that picture, there are some additional information generated by gd: `CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 95`. It gots definitely a processing, even it's not needed.
  • acrylian Administrator, Developer
    I can't reproduce that in my installation. Could you try uploading an image that is a little smaller than set in the options? If I remember right, you use a custom theme? Which function do you use for the sized images?
  • Please try this again with the nightly build.
  • It works now, thank you.
  • Good evening

    I have just installed the last version (1.4.0.1), and I can not get any more the same behaviour as mentioned above.
    Until now (ZP ver. 1.3.1), no image was generated in the cache for image with the correct size. Now I get an image generated in the cache even if the fullsizeimage has the same dimensions than the defaultsize image.
    Does someone has more information on this problem ?
    Thanks
    Erwann
  • Ok, so I finally managed to use directly the original image, by changing the image.php file.
    Instead of :
    `

    if (function_exists('printUserSizeImage') && isImagePhoto()) {

    printUserSizeImage(getImageTitle());

    } else {

    printDefaultSizedImage(getImageTitle());

    }

    `
    I put :
    `

    ?>

    image" />

    <?php<br />
    `
    But now the problem is that I have some pictures which are rely wide (panoramic pictures). So for those ones I would prefer to get the resized (and cached) version first.

    I have try to put a condition in the image.php file, like this :
    `

    if (zp_imageWidth($fullimage)>800) {

    printDefaultSizedImage(getImageTitle());

    }

    `
    But I get an error message :
    `Warning: imagesx(): supplied argument is not a valid Image resource in... `
    I did not manage to find the correct function to read the width of the image. Can somebody help ?

    Thanks,
    Erwann
  • The change you site was quite deliberate. The overhead of each time seeing if the image did not need resizing was much greater that the cost of a resize. Specially over time. The resize is done once. The testing is done every time someone visits a page with such an image.

    As to your error, a quick look at the function would show
    `
    /**
    * Returns the width of an image resource
    *
    * @param resource $im
    * @return int
    */
    function zp_imageWidth($im) {
    return imagesx($im);
    }
    `
    So, is $fullimage an image resource? I am guessing not.

    Basically what you will be doing when you get this to work is causing the actual image to be loaded into an image resource so that you can check its size.

    As mentioned above, this is much overhead for little use.
  • Thanks for your answer. I guess the correct solution would be to read directly to the "width" properties of the image in the SQL database. How could I do that simply ?

    For the future, I think it would be nice to add a general option in the admin panel, to let the user chose between resized or not resized images.
  • acrylian Administrator, Developer
    We probably won't as by standard the full image is never shown directly, always as an "extra" (since it mostly will break any theme anway). If the full image is smaller than the size set, it will be shown directly without resizing (cached anyway with 1.4.x). Unless you tell via the option to upscale.

    And not all themes have support for the usersizeimage plugin your apparently does.
  • We will not add such an option. "if you give someone a choice, they may make the wrong one."
Sign In or Register to comment.