ZenphotoCMS Forum
best url to view images from another site (eg. wordpress) - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: best url to view images from another site (eg. wordpress) (/thread-10798.html)

Pages: 1 2 3


best url to view images from another site (eg. wordpress) - blueboat - 01-02-2013

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




best url to view images from another site (eg. wordpress) - acrylian - 01-02-2013

That actually never worked. Remove the "w" and "h" part and replace it by "s".
http://www.zenphoto.org/documentation/core/_i.php.html




best url to view images from another site (eg. wordpress) - sbillard - 01-02-2013

This is not going to work because of a security hole we closed. You will have to reference the cached version of the image or look to see what Zenphoto generates for the image processor reference--there is a security parameter added that is not easily guessable.




best url to view images from another site (eg. wordpress) - blueboat - 02-02-2013

thanks guys.

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.
  1. 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.




best url to view images from another site (eg. wordpress) - sbillard - 02-02-2013

You do not have to change the theme image size to cache an arbitrary sized image. You can just set up such a size in the options for the cacheManager and select that when you cache the images.

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.




best url to view images from another site (eg. wordpress) - blueboat - 13-02-2013

no worries, thanks for the cache manager tip. i reckon closing that security hole it a good thing, even though that means plugins like zenphotopress can't work anymore. oh well, it was a good run...




best url to view images from another site (eg. wordpress) - sbillard - 13-02-2013

We have made a small modification of the security guard. Now if the image that the i.php link references has already been cached the image will be fetched. Otherwise the security guard kicks in. So all you have to do for the plugin to continue to work is to be sure you have cached the images.




best url to view images from another site (eg. wordpress) - hkdigit - 01-03-2013

sbillard, which version of zenphoto have the "small modification"?




best url to view images from another site (eg. wordpress) - acrylian - 01-03-2013

That would be the support build or the soon coming 1.4.4.2 release.




best url to view images from another site (eg. wordpress) - hkdigit - 01-03-2013

Thanks! Waiting for to get new version soon.

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




best url to view images from another site (eg. wordpress) - acrylian - 01-03-2013

I think it will support all parameters but only if the image has been cached already. (as mentioned above).




best url to view images from another site (eg. wordpress) - hkdigit - 05-03-2013

Dear acrylian,

Does 1.4.4.3 version got the new feature? If yes, it seems does not work.

Many thanks in advance.

Chris




best url to view images from another site (eg. wordpress) - acrylian - 05-03-2013

The images must have been cached already. I am not sure actually, if it is in the 1.4.4.x stream. Might be in 1.4.5 only.




best url to view images from another site (eg. wordpress) - hkdigit - 15-04-2013

acrylian,

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.




best url to view images from another site (eg. wordpress) - sbillard - 15-04-2013

1.4.5 will release in June, but it mostly complete now. You can give it a try by downloading the branch from GitHub. There is a link on the Zenphoto.org webpage over on the right hand side.




best url to view images from another site (eg. wordpress) - acrylian - 15-04-2013

There still are a few things for 1.4.5 on the list and I moved some of my tickets to 2.0 (meaning 1.4.6 actually) as I fear I won't manage it for 1.4.5.




best url to view images from another site (eg. wordpress) - sbillard - 15-04-2013

Just so we are all on the same page, with the current builds of the 1.4.4 release there is an option for Image Processor Security. When this is set there is a token added to the i.php URI that must be valid when the image is processed. This will not change.

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....)



best url to view images from another site (eg. wordpress) - hkdigit - 17-04-2013

Hi sbillard,

  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




best url to view images from another site (eg. wordpress) - acrylian - 17-04-2013

If you call that url the image will be cached if it isn't already. If you need specific sizes in bulk you need to use the cache manager.




best url to view images from another site (eg. wordpress) - hkdigit - 17-04-2013

Please advise if following steps are correct

  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.