If I change the theme Image size option from 640 to 800, the cache image URL also changed:
For example, if I view following photo:
http://www.hkdigit.net/pic/press/hkdigit-20110919-074308.jpg.htmbefore change the image size to 800 (i.e. 640 px), the image cache URL is
http://www.hkdigit.net/pic/cache/press/hkdigit-20110919-074308_640.jpgAfter change to 800 px, the URL changed to
http://www.hkdigit.net/pic/cache/press/hkdigit-20110919-074308_800.jpgHow to prevent it happen, or only cache the full size image,as I always resize before upload.
Many thanks in advance.
Regards,
Chris Lee
Comments
I guess I really do not understand your statement that you always resize before upload. You cannot either resize a single image to both those sizes.
It has been discussed before, but here it is again. Zenphoto will always create a cache version of your image in the sizes you use. That happens exactly once for each image/size. There is a simple test to see if the image is already cached.
To use the image you uploaded instead of the cache image would require a test of a fairly complex set of conditions: Is the size correct? Is there a watermark? Etc. Such tests would have to be done for each reference. The overhead of these tests simply is not warranted.
First thanks for your reply. As I want the system allow show full size image, so I usually resize the image to meet the theme layout.
For example, if the theme design to show full image (max 640 px), I will resize the image on photoshop to 640px x 480px, so I don't need zenphoto to resize for me (for better quality reason). However zenphoto always append suffix _640 after the filename on cache image. What I want is zenphoto does not add the suffix.
i.e.
http://www.hkdigit.net/pic/press/hkdigit-20110919-074308.jpg.htm
Cache file is
http://www.hkdigit.net/pic/cache/press/hkdigit-20110919-074308.jpg (<- without _640 or _800 suffix).
Is it possible?
According the following URL:
http://www.zenphoto.org/news/troubleshooting-guide
Q: Why are images of the correct size still cached additionally?
A: "If you want no processiong/caching you need to modify your theme's image.php to use the full image directly."
Any hint how to code image.php to show full image directly?
Here is my existing coding:
<!-- The Image -->
<div id="image">
<?php
// $fullimage = getFullImageURL();
$fullimage = '';
if (!empty($fullimage)) {
?>
" title="<?php echo getBareImageTitle();?>">
<?php
}
if (function_exists('printUserSizeImage') && isImagePhoto()) {
printUserSizeImage(getImageTitle(). ' - ' . getAlbumTitle() . ' - Hong Kong Digital PhotoVision');
} else {
printDefaultSizedImage(getImageTitle(). ' - ' . getAlbumTitle() . ' - Hong Kong Digital PhotoVision');
}
if (!empty($fullimage)) {
?>
<?php
}
?>
<?php
if (function_exists('printUserSizeImage') && isImagePhoto()) printUserSizeSelector(); ?>
</div>
Many thanks in advance.
Regards,
Chris Lee
THere is also a theming tutorial and a functions documentation.
PS: If you like us to view code please escape it correctly. Your example is not readable at all.