Hi folks,
What is the best URL to view ZP images from another website (eg. wordpress) so that the height and width (etc.) can be set in url parameters? This is surely documented somewhere, but I can't find it.
I have been using zenphotopress to embed images into wordpress for 6 years no problems at all. Since 1.4.4 (or 1.4.X), the image URLs are broken and need to be updated.
Here's an example of what doesn't work anymore:
http://www.exploringbliss.com/photography/zp-core/i.php?a=canada&i=20090826-Canada-2701.jpg&w=590&h=thanks for any suggestions you might have.
Cheers,
Fraser
Comments
http://www.zenphoto.org/documentation/core/_i.php.html
Below is what I ended up doing since we can't do this via url params anymore. Of course it would be easier if I just used the same size images in blog posts and in the gallery....
1) temporarily change the size of ZP images in my theme's options to match the size i need wordpress (590)
2) cache all images and change image size back to zenphoto size (795)
3) change broken img src's in wordpress to newly cached images:
- phpadmin: backup wordpress database table xx_posts, then search and export post_type "post" and export these rows to a file
- in a text editor use find and replace to change the urls as needed in the exported sql file (for me it took 3 passes to get them completely)
- delete the same rows just exported for the table xx_posts.
- import the modified sql file (and test) into table xx_posts.
4) Try to remember NOT to purge image cache!
This works fine, but I will have to remember to do 1 & 2 everytime I want to display an images in wordpress that hasn't already been cached.
Sorry about the inconvenience--but the alternative is that someone could flood your site with image resizing requests in a severe denial of service attack by issuing arbitrary image processor links.
Besides, hope i.php can continue support &s=thumb parameter as well.
For exmaple:
http://www.hkceleb.com/pic/zp-core/i.php?a=kate-tsui-tsz-shan&i=kate-tsui-20110504-131612.jpg&s=thumb
Many thanks in advance.
Chris
Does 1.4.4.3 version got the *new* feature? If yes, it seems does not work.
Many thanks in advance.
Chris
I just upgrade to 1.4.4.4, seems it does not "fix" the issue... Any hints when 1.4.5 will release... i am feature this feature for long long time...
many thanks in advance.
If the option is set and an external site issues a fetch on an i.php image link that does not have this token and if the image is not already cashed the image will not be delivered.
So your choices are:
1. Cache the images you want to display externally
2. Provide the proper uri with the token attached to the external site
3. Turn off the option (but note that this is a security issue....)
> 1. Cache the images you want to display externally
How to I generate cache image for i.php using s=thumb parameter?
For example:
http://www.hkceleb.com/pic/zp-core/i.php?a=kate-tsui-tsz-shan&i=kate-tsui-20110504-131612.jpg&s=thumb
1. On Option / Image page
unchecked "Secure image processor" checkbox
2. On Overview Page
Click "Cache" button to generate all cache image
On cache folder, I find the following cache image:
kate-tsui-20110504-131612_128_thumb.jpg
kate-tsui-20110504-131612_240_thumb.jpg
kate-tsui-20110504-131612_40_cw40_ch40_thumb.jpg
kate-tsui-20110504-131612_85_cw85_ch85_thumb.jpg
kate-tsui-20110504-131612_85_thumb.jpg
kate-tsui-20110504-131612_w128_h128_cw128_ch128_thumb.jpg
kate-tsui-20110504-131612_w75_h75_cw75_ch75_thumb.jpg
If I use the following link, the browser only return blank page:
http://www.hkceleb.com/pic/zp-core/i.php?a=kate-tsui-tsz-shan&i=kate-tsui-20110504-131612.jpg&s=thumb
Any hints?
** The above URL was generated by zenphotopress... and I have lot of Wordpress Post using it to display album thumbnail.
The image processor i,php requires also an token to work. This has been added to prevent people to overload your server by sending random requests to the image processor.
Just make sure my config is correct, please take a look on following printscreen.
http://s13.postimg.org/uhxs3c68l/Photo_Gallery_admin_options_image.jpg
If it is the correct, then there is something wrong with the coding, as it return blank page without error.
{4774:Fri, 19 Apr 2013 15:18:31 GMT} Zenphoto v1.4.4.4[121605f7d74b874e059338dee7accca873881c6d]
Loading GD
{4774:Fri, 19 Apr 2013 15:18:32 GMT}
i.php(kate-tsui-tsz-shan, kate-tsui-20110504-131612.jpg): $size=, $width=, $height=, $cw=, $ch=, $cx=, $cy=, $quality=85, $thumb=, $crop=, $thumbstandin=, $passedWM=, $adminrequest=, $effects=
{4774:Fri, 19 Apr 2013 15:18:32 GMT}
cacheImage($imgfile=kate-tsui-20110504-131612.jpg, $newfilename=/kate-tsui-tsz-shan/kate-tsui-20110504-131612.jpg, $allow_watermark=1, $theme=hkceleb4) $size=, $width=, $height=, $cw=, $ch=, $cx=NULL, $cy=NULL, $quality=85, $thumb=, $crop= $image_use_side=longest; $upscale=0);
{4848:Fri, 19 Apr 2013 15:18:36 GMT}
Loading GD
Seems no error appear. Any hints?
"GET /pic/zp-core/i.php?a=kate-tsui-tsz-shan&i=kate-tsui-20110504-131612.jpg&s=thumb HTTP/1.1" 404 - "-" "Mozilla/5.0 (Windows NT 6.1; rv:20.0) Gecko/20100101 Firefox/20.0"
If I omit &s=thumb parameter, zenphoto can return image.
Any hints?
For example:
http://www.hkgimages.com/pic/zp-core/i.php?a=sports/marathon/2013&i=hkgimages-20130224-083702-01.jpg&s=thumb
will return following thumbnail:
http://www.hkgimages.com/pic/cache/sports/marathon/2013/hkgimages-20130224-083702-01_75_cw75_ch75_thumb.jpg