How to not create a cached and resized image

This is my first day digging around zenphoto, so pardon me if I ask something silly.

It appears that zenphoto creates 2 cached copies of each original image in my alburm: 1 thumbnail-sized copy and 1 copy sized according to the "image size" setting in admin options. Is it possible to have zenphoto not create the larger of the two cached copies? I like the thumbnail, but when I click on the thumbnail, I want to see the original image, not an intermediate resized version of the original.

Thanks in advance.

Comments

  • Pretty easy actually but you're killing the cool part of ZP!

    open up your album.php theme file, look for where your images are printing, if its the default theme then its line 48, replace <?php echo getImageLinkURL();?> with <?=getFullImageURL();?> and you're done.
  • Thanks for the quick response.

    Ah getFullImageURL() sounds promising. I was hoping there was a built-in option I overlooked so I wouldn't have to go code hacking. ;)

    I think I want to make the modification in image.php and not album.php though. I don't want to break out of zenphoto and view an image directly; I want zenphoto to display the fullsize image instead of the larger-than-thumbnail but still resized image. Does that make sense? I don't think I'm killing any cool part of ZP. :(

    I plan to upload images that are already the correct size for fullscreen viewing, so having zenphoto resize each image unnecessarily seems a waste of system resources and disk space in my case.
  • acrylian Administrator, Developer
    Of course you have to edit image.php.

    If you don't want to "hack" anything, you can set a bigger image size in the admin than all your original images have and then disable "allow upscale" in the admin (already default) and zp will show your images as uploaded.

    But keep in mind that you compress your uploaded images the right way before, otherwise visitors with slower connections will have no fun.
  • "you can set a bigger image size in the admin than all your original images have and then disable "allow upscale" in the admin (already default) and zp will show your images as uploaded."

    Thanks, I thought about doing that too. However, images will still be recompressed and saved in the cache directory even if the image size is larger than the original and upscale is off, correct?

    I had another thought, maybe a more elegant hack. Instead of changing the <img> link in image.php of a theme, add an option in the admin interface, like "show original images" or "disable image resizing (except thumbnails)". If this option is enabled, the function that normally returns the URL of the resize/cached image returns the URL for the original image.
  • Let me try to get you straight....

    You are wanting the gallery to function just as it does but instead of creating a resized image on image.php you want it to load the full image?

    If that is what you want to do then change

    `

    <.a href="<?php echo getFullImageURL();?>" title="<?php echo getImageTitle();?>"> <?php printDefaultSizedImage(getImageTitle()); ?></.a>

    `

    to

    `

    image" />

    `

    in your image.php theme page (line 46 of default)
  • aitf311: Yep, that's exactly it. Thanks. ^_^

    Wow, another point for zenphoto. You devs are so helpful and responsive. Cheers!
  • acrylian Administrator, Developer
    Yep, aitf311 is right. But better don't use the php short tag, instead write in full:
    `image" />`
  • jley Member
    Hello... This is a pretty old thread, but I have this same question, and it seems the code in image.php has changed.

    I looked for some kind of option in the admin screens, but could not find it.

    Anyway, I re-size my images before uploading them, so I don't want zenphoto to re-compress them, as it makes the images displayed in the gallery a bit fuzzy.

    any advice? Thanks!
  • jley Member
    Ah... after a bit more digging, I see this was addressed in another thread at:
    http://www.zenphoto.org/support/topic.php?id=10548

    In particular, the last 2 posts there. And, it works...

    Thanks!
Sign In or Register to comment.