Hey guys i have made an app for Piwigo gallery that help users to post photos from gallery into other software like Worpress or various forums types. http://piwigo.org/ext/extension_view.php?eid=835
I want to make something similar for Zenphoto.
But i have some problems
Current api seem unsupported by it's original autor. Both Piwigo and Menalto Gallery 3 have api that are officially supported and documented. Please support your Zenphoto REST api officially. They are some bugs some incomplete stuff, and there is no documentation for it.
Is possible to make the derivative file names not contain the size in pixels? Because having that number in the filename easily will broke any links to the thumbnail and websize in the future.
For example if a software like mine generate a bbcode like this for a forum software:
[Image: http://site.com/cache/someuser/filename_..._thumb.jpg]
If the user change the size of the thumbnails or websize then the original link embeded in other software can be broken.
Piwigo dont have that size included in the filenames. They use something like this
filename-sq.jpg (square thumbnail)
filename-th.jpg (small thumbnail)
filename-me.jpg (websize thumbnail)
filename.jpg (original filename)
When user change the size option in his options panel he is not broking the past links.
For now you would have to use RSS. There is an probably rather inconvenient externalRSS plugin you could use for now.
then ...
also got the same bug like this guy reported 9 months ago and the autor didn't fix the problem
https://github.com/deanmoses/tacocat-gallery-zenphoto-rest-api/issues/4
Sorry, cannot say much to that as I didn't actually use that plugin. The plugin I have in mind will mirror the standard front end usage more or less.
Well, it is how Zenphoto works and this will not be changed. Those cached images are not fixed, the cache may be deleted so it is not recommended to link to that directly with fixed links. Instead use the image processor if you are not sure. That will either create the cache image or serve existing ones. Which actually the api would do before returning anything.
can you give an example how "i.php" query parameter would look like to be equivalent with this kind of links?
websize:
http://site.com/cache/someuser/filename_595.jpg = http://site.com/i.php?...
thumb:
http://site.com/cache/someuser/filename_150_cw150_ch150_thumb.jpg = http://site.com/i.php?...
Hi, I'm the guy that wrote that unsupported REST API and didn't fix anything for a year. Believe me, I'd also love it if there were an official, supported API!
But in the meantime I fixed up mine.
It's at a new location:
https://github.com/deanmoses/zenphoto-json-rest-api
@deanmoses
The "deep" parameter seems nice, allowing me to fix one of the problems.
I will take a look at the api new version when I will have some free time.
@acrylian
By "file's docblock" you mean looking at the "i.php" source code, or there is some sort of documentation for zenphoto?
I know this topic is quite old, but wanted to add anyway in case someone has the same requirements.
- Is possible to make the derivative file names not contain the size in pixels? Because having that number in the filename easily will broke any links to the thumbnail and websize in the future.
For example if a software like mine generate a bbcode like this for a forum software:
[Image: http://site.com/cache/someuser/filename_..._thumb.jpg]
If the user change the size of the thumbnails or websize then the original link embeded in other software can be broken.
Piwigo dont have that size included in the filenames. They use something like this
filename-sq.jpg (square thumbnail)
filename-th.jpg (small thumbnail)
filename-me.jpg (websize thumbnail)
filename.jpg (original filename)
When user change the size option in his options panel he is not broking the past links.
You could use a .htaccess rewrite rule for those pre-defined image sizes. Something like this (untested):
RewriteRule ^(.*)(-sq\.jpg)$ $1_150_cw150_ch150_thumb.jpg
This should match all file requests ending in -sq.jpg and redirect those requests to the same filename but ending in _150_cw150_ch150.jpg instead.
Once you decide to go to 175 px sized thumbnails (for example) you just change the rewrite rule and you're done (caching aside as noted above).
You should really not rely on someething like this as just a theme of plugin may not use that size. The cached file names contain the size parameters for a reason. Zenphoto does not have fixed sizes like Piwigo or other CMS have, themes and plugins can use whatever they want whenever they want.