Zen Cart Logo
Forums / All Other Contributions/Addons / Image Handler 4 (for v1.5.x) Support Thread

Image Handler 4 (for v1.5.x) Support Thread

Views: 343,244

Results 1,401 to 1,420 of 1,691
6 Aug 2015, 3:56 PM
#1401
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Image Handler 4 (for v1.5.x) Support Thread

kitcorsa:

Can someone tell me the DB tables the IH uses please, Im currently trying to intergrate my ZC store into my SAP system and would also like the aditional images to populate from my database, I can't seem to figger out how IH knows the connection for the item id number and the original file names of the aditional images stored on the server.

Thanks

May not have made as much sense then as it will shortly, but it has been stated multiple times that IH effectively uses the same image information as the default ZC store, so it uses the products table with the products_image information... All "additional images" are named in the applicable images/PATH folder as relates to the way ZC processes/handles images... So to get your additional images really should be looking at additional_images.php related code, not so much IH as far as obtaining the path(es) to the original file(s)... (the modified version as made available by IH, that's a different story and somewhat depends on the version being used, etc...)

6 Aug 2015, 4:17 PM
#1402
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

I understand how the ZC additonal images works ie productone_1 productone_2 etc but that uses the images names to reference the images to the products, the way my site is we have additional images added via IH4 which have a totally different and unrelated name for example, we might have a ford focus for sale with the photo focus_1.jpg but also have a photo of a technical spec (generic to all model cars) also added with the name techspec.jpg, so in normal terms ZC wouldn't make the connection... but IH4 does.

I was assuming that IH4 had a table in the DB somewhere that had additonal images defined, ie ID1, techspc.jpg, techford1.jpg etc am i assuming wrong and it is not possible for me to find the defining link between the product id and the additonal image file names?

6 Aug 2015, 6:06 PM
#1403
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

kitcorsa:

I understand how the ZC additonal images works ie productone_1 productone_2 etc but that uses the images names to reference the images to the products, the way my site is we have additional images added via IH4 which have a totally different and unrelated name for example, we might have a ford focus for sale with the photo focus_1.jpg but also have a photo of a technical spec (generic to all model cars) also added with the name techspec.jpg, so in normal terms ZC wouldn't make the connection... but IH4 does.

I was assuming that IH4 had a table in the DB somewhere that had additonal images defined, ie ID1, techspc.jpg, techford1.jpg etc am i assuming wrong and it is not possible for me to find the defining link between the product id and the additonal image file names?

I haven't checked out the github version to see if/how it assgns additional image names differently than it did in the past, but through the versions previously, such a differently named file would be saved with the nme of the original file and either the automatic extension, or the one of choice to still provide additionl image generation.

If you are using the github version and it offers such new naming convention then for the moment I'm stepping out on the discussion.

7 Aug 2015, 9:16 AM
#1404
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

the site was originally 1.3.7 and have upgraded through the years and the mod has been upgraded as well as required, dont know if that makes any difference.

but when i look in the DB or easy populat download the images in the product_image table are all the original names, but down show any of the additonal images, so i cant make the connection there.

Does IH4 take the first default image, copy it, rename, then make all the additional images on the fly renaming them to suit to use the ZC process?? if so... how can i find the IM4 name for the first image to find the additional images and create the link??

7 Aug 2015, 11:09 AM
#1405
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

kitcorsa:

the site was originally 1.3.7 and have upgraded through the years and the mod has been upgraded as well as required, dont know if that makes any difference.

but when i look in the DB or easy populat download the images in the product_image table are all the original names, but down show any of the additonal images, so i cant make the connection there.

Does IH4 take the first default image, copy it, rename, then make all the additional images on the fly renaming them to suit to use the ZC process?? if so... how can i find the IM4 name for the first image to find the additional images and create the link??

Historically the process has been like this:

  1. Admin, identify that an image is to be associated with a product.
  2. Image is uploaded with the ability to identify the base product name as something other than the name of the file being uploaded.
  3. After upload, the file is stored using the new filename and the database is updated with the path/filename selected in the first upload.
  4. Subsequent images (additonal images) are then able to be uploaded but with the ability to alter the suffix applied which will be used to name the uploaded file and maintain as an additional image to the primary image.

Then on the store side:

  1. The main image is pulled from the products table, and all images that meet the beginning part of the filename up to it's extension.
  2. IH4 then uses those filenames to perform calculations to modfy/compress the images and pull the resulting image from the "calculated" location. If the image does not exist at that location, then it is created on the fly to be referenced again in the future.

Historically that filename was made through a hash algorithm; however, the newer version on github is to make the filename a "legible" filename. Now is it possible that there is some method used to provide a dfferent display name for the file when presented online? Certainly... But that would be a result of basically sending the filename through the image_handler portion of the code.

That help any?

7 Aug 2015, 12:27 PM
#1406
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 4 (for v1.5.x) Support Thread

kitcorsa:

Does IH4 take the first default image, copy it, rename, then make all the additional images on the fly renaming them to suit to use the ZC process??That's how it works in a nutshell..

kitcorsa:

how can i find the IM4 name for the first image to find the additional images and create the link??As MC12345678 pointed out this renaming was done using an MD5 hash. In order to find the REAL file names you will have to find some tool which can interpret the MD5 hash based names in the bmz_cache folders and "interpret" them to get the real file name.

The IH4 version available in Github addresses this by giving the bmz_cache files REAL names..

7 Aug 2015, 1:09 PM
#1407
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Image Handler 4 (for v1.5.x) Support Thread

DivaVocals:

That's how it works in a nutshell..

As MC12345678 pointed out this renaming was done using an MD5 hash. In order to find the REAL file names you will have to find some tool which can interpret the MD5 hash based names in the bmz_cache folders and "interpret" them to get the real file name.

The IH4 version available in Github addresses this by giving the bmz_cache files REAL names..
Actually, to determine the IH4-md5 name for the image, you'll need to know the image's real name and the IH4 controls applied to that image (watermark, zoom, quality and background). An MD5 hash is one-way, you can't look at the hashed file-name and work back to the real one!

Refer to the get_resized_image function in /includes/classes/bmz_image_handler.class.php and its use of the getCacheName function. The first parameter to getCacheName is the 'glob' that gets run through the md5() function to produce a unique file-name.

7 Aug 2015, 3:02 PM
#1408
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

Sum and total though, the original files, including additional images as described in the documentation for IH4 follow the source server namng convention of ZC. The original files can be found in the designated folder, then with the name assigned to the main image as the prefix to the image and whatever suffix was applied whether automated or self designated. Each such image to have the same extension (.gif, .jpg, etc.) as the primary image. Thus addtional image location code would work the same as base ZC functionality.

That said, to find the resized image(s) the above discussion applies, but from the sounds of it, the issue was tryng to locate the orginal files. If the resized files are the target, then need to invoke the applicable code to translate the desired image to the bmz_cache related file.

7 Aug 2015, 3:09 PM
#1409
mcgill avatar

mcgill

Zen Follower

Join Date:
Aug 2005
Posts:
101
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

Hi the install inage handler link is missing in tools, any ideas?

7 Aug 2015, 3:55 PM
#1410
mcgill avatar

mcgill

Zen Follower

Join Date:
Aug 2005
Posts:
101
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

Hi
the install link in tools is missing, any clues?

7 Aug 2015, 4:34 PM
#1411
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

DivaVocals:

That's how it works in a nutshell..

As MC12345678 pointed out this renaming was done using an MD5 hash. In order to find the REAL file names you will have to find some tool which can interpret the MD5 hash based names in the bmz_cache folders and "interpret" them to get the real file name.

The IH4 version available in Github addresses this by giving the bmz_cache files REAL names..

so would upgrading to the github version and then running the update all old images, give me a way to be able to work out a way to help with and import into my SAP system and link zen-cart and SAP. I have everything else working bar additional images :-(

if not im going to have to find a different way that zzencart works out this assosiation of images and products or basically start renaming and re uploading all images for products again... 10k lat check on the server.

7 Aug 2015, 7:21 PM
#1412
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

kitcorsa:

so would upgrading to the github version and then running the update all old images, give me a way to be able to work out a way to help with and import into my SAP system and link zen-cart and SAP. I have everything else working bar additional images :-(

if not im going to have to find a different way that zzencart works out this assosiation of images and products or basically start renaming and re uploading all images for products again... 10k lat check on the server.

What aspect of the additional images are you trying to get into your SAP system?

Basically everything you need is available either in or from includes/modules/YOUR_TEMPLATE/additional_images.php.

With the variable $products_image assigned to either PRODUCTS_IMAGE_NO_IMAGE or the database value of products_image obtained from the products table, and $flag_show_product_info_additional_images != 0, then the module as called by:

require(DIR_WS_MODULES . zen_get_module_directory('additional_images.php'));

sets/retrieves the data associated with the additional images for display as shown in the product_info page, otherwise an alternate version of the file could be used to provide the desired results... If you want a standard path/image that does not take advantage of the IH4 functionality then using the default version of includes/modules/additional_images.php will be sufficient and again a modified version (renamed to something else) may support the results you are looking for.

There's not much more to it. The github version will just provide a path that is "pretty" instead of the path that is made up of all sorts of letters, numbers, folders, etc... Basically if you have the main image working, then the additional images follows from the information obtained/used to retrieve the main image...

7 Aug 2015, 7:23 PM
#1413
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

McGill:

Hi
the install link in tools is missing, any clues?

Need more information, please see the posting tips that appear above when replying to a message. (click reply or reply with quote and then scroll up)

7 Aug 2015, 7:27 PM
#1414
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 4 (for v1.5.x) Support Thread

lat9:

Actually, to determine the IH4-md5 name for the image, you'll need to know the image's real name and the IH4 controls applied to that image (watermark, zoom, quality and background). An MD5 hash is one-way, you can't look at the hashed file-name and work back to the real one!There are MD5 hash decrypter tools.. dunno how well they will work with the IH4 cached files names as to your point other factors play into the filenaming for the cache..

7 Aug 2015, 7:30 PM
#1415
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Image Handler 4 (for v1.5.x) Support Thread

McGill:

Hi
the install link in tools is missing, any clues?

Nope..something you installed broke IH by removing it.. Reinstall IH..

8 Aug 2015, 2:21 PM
#1416
kitcorsa avatar

kitcorsa

Totally Zenned

Join Date:
Feb 2007
Posts:
1,724
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

Basicically what i need to do is do a full migration from ZC to my SAP system so my website and instore / stock management / vehicle tracking and store (high street shop) sales all tie into together.

I have migrated everything and got everything working to gether fine appart from the additonal images as i cant see in the database the additonal images or a way to work out what image is what in the cahce folder etc.

ie database shows my product id1 is called x and costs x and has image x.jpg etc but the additonal image upload via ih4 is called y.jpg and and i see in the databse how ZC knows to pull up y.jpg as an additional image for product x id1.... has to be there somewhere.

mc12345678:

What aspect of the additional images are you trying to get into your SAP system?

Basically everything you need is available either in or from includes/modules/YOUR_TEMPLATE/additional_images.php.

With the variable $products_image assigned to either PRODUCTS_IMAGE_NO_IMAGE or the database value of products_image obtained from the products table, and $flag_show_product_info_additional_images != 0, then the module as called by:

require(DIR_WS_MODULES . zen_get_module_directory('additional_images.php'));

> sets/retrieves the data associated with the additional images for display as shown in the product_info page, otherwise an alternate version of the file could be used to provide the desired results... If you want a standard path/image that does not take advantage of the IH4 functionality then using the default version of includes/modules/additional_images.php will be sufficient and again a modified version (renamed to something else) may support the results you are looking for.
> 
> There's not much more to it.  The github version will just provide a path that is "pretty" instead of the path that is made up of all sorts of letters, numbers, folders, etc...  Basically if you have the main image working, then the additional images follows from the information obtained/used to retrieve the main image...
8 Aug 2015, 3:05 PM
#1417
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

Maybe it's hidden in the below message, but could you provide a link to a page where there are additional images to maybe see what you are talking about? Again, iH4 does nothing "special" tothe naming of additional image files that breaks the normal process of naming. If you can migrate a standard ZC that has addtional images, you can do so for one with IH4 installed...

The code in includes:modules/additional_images.php (or the overridden one for IH4) takes the information for the main product (coming from the database record for products_id=x) and identifies all of the images that are considered associated with the product. If you have had that or similar files modified to do something other than the base action, then may I suggest returning to the one that modified t for you or looking for someone else to support this effort.

If the main image was saved as y.jpg, then all additional images for that product will begin wth y and end with .jpg and have some middle name such as. _1, _2, etc for each additional image... If you need to capture in some sort of database the actual name of each additional image, then you need to translate/capture that through the use of the above file or a modified version of it... Regardless I think this has gotten to the point that it is not an issue associated with IH4 as IH4 does nothing beyond standard processng for additional images... Makes life easier, but in that regards doesn't modify the image handling of additional images.

kitcorsa:

Basicically what i need to do is do a full migration from ZC to my SAP system so my website and instore / stock management / vehicle tracking and store (high street shop) sales all tie into together.

I have migrated everything and got everything working to gether fine appart from the additonal images as i cant see in the database the additonal images or a way to work out what image is what in the cahce folder etc.

ie database shows my product id1 is called x and costs x and has image x.jpg etc but the additonal image upload via ih4 is called y.jpg and and i see in the databse how ZC knows to pull up y.jpg as an additional image for product x id1.... has to be there somewhere.

24 Aug 2015, 11:28 AM
#1418
karinvd avatar

karinvd

New Zenner

Join Date:
Nov 2012
Location:
Utrecht, Nederland
Posts:
43
Plugin Contributions:
0

Re: Image Handler 4 (for v1.5.x) Support Thread

I have a question: Is it possible to have 2 sites using the same images with image handler when one of the site is placed in a subdomain? At this moment i am testing with 2 sites using the same database. The site in the sub domain is now using the images from the shop in the root. Thats ok, but i want the shop to use the images from de /bmz_cache folder from the shop in the root. Right now i defined the images folder in the configure file.
The reason i would like to do this is because the site in the sub domain is a mobile site. Using its own files but sharing the database with the shop in the root.
And, second question if it is possible where should i start?
I'm using zencart 1.5.4. and image handler downloaded from git_hub because i like the image names better.

24 Aug 2015, 12:30 PM
#1419
niccol avatar

niccol

Totally Zenned

Join Date:
Apr 2009
Posts:
2,138
Plugin Contributions:
1

Re: Image Handler 4 (for v1.5.x) Support Thread

You can't get the information about the additional images from the database. It is not stored in there. You are going to have to do some programming to search for the additional images ( same way as Zen does ) and export them that way.

I'd try updated versions of IH from git to solve the naming issues. The hashing thing makes finding them complex.

kitcorsa:

Basicically what i need to do is do a full migration from ZC to my SAP system so my website and instore / stock management / vehicle tracking and store (high street shop) sales all tie into together.

I have migrated everything and got everything working to gether fine appart from the additonal images as i cant see in the database the additonal images or a way to work out what image is what in the cahce folder etc.

ie database shows my product id1 is called x and costs x and has image x.jpg etc but the additonal image upload via ih4 is called y.jpg and and i see in the databse how ZC knows to pull up y.jpg as an additional image for product x id1.... has to be there somewhere.

24 Aug 2015, 7:41 PM
#1420
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Image Handler 4 (for v1.5.x) Support Thread

karinvd:

I have a question: Is it possible to have 2 sites using the same images with image handler when one of the site is placed in a subdomain? At this moment i am testing with 2 sites using the same database. The site in the sub domain is now using the images from the shop in the root. Thats ok, but i want the shop to use the images from de /bmz_cache folder from the shop in the root. Right now i defined the images folder in the configure file.
The reason i would like to do this is because the site in the sub domain is a mobile site. Using its own files but sharing the database with the shop in the root.
And, second question if it is possible where should i start?
I'm using zencart 1.5.4. and image handler downloaded from git_hub because i like the image names better.

If not mistaken it primarily revolves around the variable $ihConf['dir']['docroot'] set in includes/functions/extra_functions/functions_bmz_image_handler.php

Though I believe there are some other areas where tests are performed against the existence of the image(s) which may not quite work out right without additional coding... But, many of the IH tests are performed and data is "written" with relationship to the docroot. Would suggest to also work "backwards" from where the generated URI is created for the image to see what if any other values need to be incorporated to "move" up a directory (elsewhere) in order to provide the bmz_cache related images as compared to the base URI address on the page, and if working with SSL, would need to also ensure that any links to the image(s) were of the same request type. In a way it may actually be easier/better to have all of the images hosted in this new sub-directory or whatever it is than the root. At least that way they would be directly accessible by digging deeper not coming back out... Either way seems like making it complicated... :)