Re: Image Handler 5 (for v1.5.5) Support Thread
Hi
This is a general question:
Is there a simple way to get the IH image ?
Asking this, because I doing a autocomplete search box and if possible, it would be best to use already resized images.
I'm following the admin image_handler page, but I guess that's for comparing , etc...
Thanks
Re: Image Handler 5 (for v1.5.5) Support Thread
Quote:
Originally Posted by
mesnitu
Hi
This is a general question:
Is there a simple way to get the IH image ?
Asking this, because I doing a autocomplete search box and if possible, it would be best to use already resized images.
I'm following the admin image_handler page, but I guess that's for comparing , etc...
Thanks
Is this for a storefront or admin search box?
Re: Image Handler 5 (for v1.5.5) Support Thread
In this case Store front
thanks
Re: Image Handler 5 (for v1.5.5) Support Thread
That one's easy, then! When you call the zen_image() function and have IH loaded and enabled, that function (in turn) calls the IH function to handle that image. Net/net, that's the way to get a resized/cached version of the image.
Re: Image Handler 5 (for v1.5.5) Support Thread
Thanks
So I guess the other one it's difficult,... and that's the one I need. I didn't explain myself. The autocomplete is for the store front, but ,(still testing) I'm creating a json file in the admin area, so it's there that I need to get the IH (small) image path.
Re: Image Handler 5 (for v1.5.5) Support Thread
Quote:
Originally Posted by
mesnitu
Thanks
So I guess the other one it's difficult,... and that's the one I need. I didn't explain myself. The autocomplete is for the store front, but ,(still testing) I'm creating a json file in the admin area, so it's there that I need to get the IH (small) image path.
The admin-side is a bit more complicated, since that version of the zen_image function doesn't look for/use the IH-supplied re-formatting. Which type of Cache File-Naming Convention are you using?
Re: Image Handler 5 (for v1.5.5) Support Thread
Quote:
Originally Posted by
lat9
Which type of Cache File-Naming Convention are you using?
That's a IH5 feature right ? I'm still using IH4, but I intend to move to IH5, but I didn't had the time yet.
Perhaps I shod upgrade first and ask later ... is this stable now ?
Re: Image Handler 5 (for v1.5.5) Support Thread
Quote:
Originally Posted by
mesnitu
That's a IH5 feature right ? I'm still using IH4, but I intend to move to IH5, but I didn't had the time yet.
Perhaps I shod upgrade first and ask later ... is this stable now ?
The GitHub repository is in a bit of flux, but the released version is stable. Since you're using IH4, you're using the hashed version of the cache file naming.
I'd recently looked this up for a client, so here's the process, assuming that you're using the IH-4/5 default settings.
- Take the products_image definition from the products table in the database, let's call this $products_image.
- Prepend that value with the images' directory: $image_source = DIR_WS_IMAGES . $products_image;
- Append that value with the default settings: $image_source .= ('85' . '255:255:255' . 'Center');
- Create an md5-hash of that value: $cache_filename = md5($image_source);
That $cache_filename now contains the filename portion associated with the cached image. Images are stored in the /bmz_cache/$cache_filename[0]/$cache_filename.image.$dimensions.$extension, where $dimensions = $width . 'x' . $height (of the image) and $extension is the image-file's base extension.
That description's probably a bit muddy; just post back if you have additional questions.
Re: Image Handler 5 (for v1.5.5) Support Thread
Thank you! I'll be looking if I can do this.
It would be a nice addition to IH.
Recently I made some changes how to handle images with ep4bookx ( import addition to deal with bookx product type using EP4).
And basically, it allows to rename, resize, download books images or authors images from a temp folder, to the destination folders.
I had to search for some script to use GD, since I didn't manage to use IH. ( maybe my fault).
Another thing that I'm planing to do, is to create export newsletter to MailChimp ( html format).
And it would be nice to use IH.
What I'm trying to say, is that IH could be a "library" to image handling, globally.
But, I do understand the amount of work and that somebody has to pay the bills.
Thanks
Re: Image Handler 5 (for v1.5.5) Support Thread
Quote:
Originally Posted by
mesnitu
Thank you! I'll be looking if I can do this.
It would be a nice addition to IH.
Recently I made some changes how to handle images with ep4bookx ( import addition to deal with bookx product type using EP4).
And basically, it allows to rename, resize, download books images or authors images from a temp folder, to the destination folders.
I had to search for some script to use GD, since I didn't manage to use IH. ( maybe my fault).
Another thing that I'm planing to do, is to create export newsletter to MailChimp ( html format).
And it would be nice to use IH.
What I'm trying to say, is that IH could be a "library" to image handling, globally.
But, I do understand the amount of work and that somebody has to pay the bills.
Thanks
Umm... Do you need just the filename or do you need the html <img> tag that provides the image? (or even from that to pull the filename?) If you use the zen_image function to return the generated value, then you will receive the html tag that should contain all that is necessary to display the image. If it is the directory path only needed then the string can be parsed from the content (src parameter), if it is an image tag, then it is the entire returned value from the function.