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,281

Results 1,421 to 1,440 of 1,691
29 Aug 2015, 10:27 AM
#1421
karinvd avatar

karinvd

New Zenner

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

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

Thank you @mc12345678 I did find the variable $ihConf['dir']['docroot'] but it is not enough to change it. Thanks for the idea to put all images in the subdiretory in stead of the root. . Thats something i dit not think of! I'll keep on trying :-)

29 Aug 2015, 1:12 PM
#1422
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

Before I do a lot of digging can someone visit my site to see if this plugin is actually working? ATM I cannot use Chrome so I am being forced in to Windows Edge. The site is not working in edge. So if someone using Chrome visit this page and let me know if it is working. Thank you in advance.

29 Aug 2015, 1:18 PM
#1423
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

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

adb34:

Before I do a lot of digging can someone visit my site to see if this plugin is actually working? ATM I cannot use Chrome so I am being forced in to Windows Edge. The site is not working in edge. So if someone using Chrome visit this page and let me know if it is working. Thank you in advance.

Did you turn IH resize images to "yes" ? When looking in Chrome and FF, both give the default paths to the images.

29 Aug 2015, 5:20 PM
#1424
adb34 avatar

adb34

Totally Zenned

Join Date:
Mar 2008
Location:
Brampton, Cumbria, United Kingdom, United Kingdom
Posts:
825
Plugin Contributions:
0

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

Design75:

Did you turn IH resize images to "yes" ? When looking in Chrome and FF, both give the default paths to the images.

Oh.........no :no: ........have now . :censored:?

All I need to do is sort out the popup image size and I will be happy. Thank you for pointing out that I cannot read (lol).

16 Sep 2015, 11:29 PM
#1427
b_noid avatar

b_noid

New Zenner

Join Date:
Sep 2015
Location:
Montreal, Canada
Posts:
5
Plugin Contributions:
0

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

Hi everybody!
I wanted to share a small modification i did to auto generate the path for the image in the Image Manager.
Use it at your own risk

When you add the first image to an item it generates the path for where it will be stored.
I manage multiple site and i wanted one site to create the path with the category and sub-category and the rest of my sites based on the manufacturer.

So here it goes :
First, add these function to the top of /yourAdmin/image_handler.php (I added them around line 36)

function replace_weird_char($str){
    $unwanted_array = array(    'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 
                        'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 
                        'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 
                        'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 
                        'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 
                        'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 
                        'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 
                        'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 
                        'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 
                        'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u',
                        'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', '/'=>'', '\\'=>'', 
                        ' '=> '-', '.'=>'_', '®'=>'', '™'=>'' );
    return strtr( $str, $unwanted_array );
}

function get_new_img_path($product_id, $base = '', $create_path_from = ''){
    $path = '';
    switch ($create_path_from) {
        case 'category':
            $cat_array = zen_generate_category_path($product_id, 'product');
            $temp_path = '';
            $is_first = true;
            foreach ($cat_array[0] as $value) {
                if (!$is_first) {
                    $temp_path .= '/';
                }
                $temp_path .= replace_weird_char($value['text']);
                $is_first = false;
            }
            if ($temp_path != '') {
                $path = $base != '' ? ' value="' . $base . '/' . $temp_path . '"' : ' value="' . $temp_path . '"';
            }
            break;
        case 'manufacturer':
            $manufacturer_name = replace_weird_char(zen_get_products_manufacturers_name($product_id));
            if ($base != '') {
                $path = ' value="' . $base . ($manufacturer_name != '' ? '/' . $manufacturer_name : '') .'"';
            } else {
                $path =  ($manufacturer_name != '' ? ' value="' . $manufacturer_name .'"' : '');
            }
            break;
        case '':
            $path = $base != '' ? ' value="' . $base . '"' : '';
            break;
    }
    return strtolower($path);
}  

The function replace_weird_char($str) replaces the characters you don't want in a file path. You can add any character you want in the array.
The second function get_new_img_path(...) creates the path according to the information you supplied. (Explained in the next section)

Second, change this line (around line 867) :

$contents[] = array('text' => TEXT_INFO_OR.' ' . zen_draw_input_field('imgNewBaseDir', '', 'size="20"') );

to this :

$contents[] = array('text' => TEXT_INFO_OR.' ' . zen_draw_input_field('imgNewBaseDir', '', 'size="20"' . get_new_img_path($pInfo->products_id, 'products', 'manufacturer'))  );

This is where the magic happens. The function get_new_img_path receive 3 parameters.
The first one is the product id, don't change it.
The second is the base of the path. If you enter 'products' the path will start with 'product/[something]'.
The last is the type of path you want, you have 3 options ('', 'category' or 'manufacturer')

Here is some example :

  • get_new_img_path($pInfo->products_id, 'products', 'manufacturer')
    output : 'products/[manufacturer]/'
  • get_new_img_path($pInfo->products_id, '', 'manufacturer')
    output : '[manufacturer]/'
  • get_new_img_path($pInfo->products_id, '', '')
    output : ''
  • get_new_img_path($pInfo->products_id, 'products', 'category')
    output : 'products/[category]/[sub-category]/[sub-category]/.../[sub-category]/'
  • get_new_img_path($pInfo->products_id, 'products', 'category')
    output : '[category]/[sub-category]/[sub-category]/.../[sub-category]/'

Finally, i had to make a small modification to the database because the maximum number of characters in the file path for the image is 64 and you can easily go over this with the category option.
In the table 'products' the field 'products_image' needs to be change from varchar(64) to varchar(200). (I choose 200 but less could work to, i just didn't want to bother with it anymore...)

This has been tested on 4 different website and with more than 5000 items but it still should be tested thoroughly before going to a live site.

I hope it can help some of you out!
Have a good one! :cool:

22 Sep 2015, 10:14 AM
#1428
joecooper avatar

joecooper

Zen Follower

Join Date:
Aug 2011
Posts:
122
Plugin Contributions:
0

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

Hi,

Running 1.5 with ZenCart.

Our client has a site which has image handler. Although it has never worked properly, and often is unable upload images.

I am doing some testing today, however I am stuck without being able to load up a product at all within image uploader. I am faced with the same message:

"No Image Handler information found."

Any clue where to start with this error?

22 Sep 2015, 10:30 AM
#1429
design75 avatar

design75

Totally Zenned

Join Date:
Dec 2009
Location:
Amersfoort, The Netherlands
Posts:
2,862
Plugin Contributions:
5

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

joecooper:

Hi,

Running 1.5 with ZenCart.

Our client has a site which has image handler. Although it has never worked properly, and often is unable upload images.

I am doing some testing today, however I am stuck without being able to load up a product at all within image uploader. I am faced with the same message:

"No Image Handler information found."

Any clue where to start with this error?

some other modules remove the version constant from the database when they are installed.
Insert this in your database, and it should work again. You should edit the version number to the version you are you using.

INSERT INTO configuration ('configuration_title', 'configuration_key', 'configuration_value', 'configuration_description', 'configuration_group_id', 'sort_order', 'last_modified', 'date_added', 'use_function', 'set_function') VALUES ('IH version', 'IH_VERSION', '4.3.2', 'IH Version is stored but not shown on configuration menus', '6', '10000', NULL, '0001-01-01 00:00:00.000000', NULL, NULL);
2 Oct 2015, 11:32 PM
#1430
eyeb avatar

eyeb

New Zenner

Join Date:
Aug 2013
Location:
United States
Posts:
37
Plugin Contributions:
0

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

Hello. Zen Cart 1.5.4 - Issue with Larger Image Upload
Anytime we upload an image larger than 2700 pixels (there-abouts) the admin page for Image Handler breaks in 1/2 - if you view source the code literally stops 1/2 way down the page...the last line of code in the source is:
<td class="dataTableContent" align="center" valign="top">

And you can't upload anymore images - there is not button to add more. It seems if you upload an image smaller than 2700 px wide we are fine.

We recently upgraded the site - new theme - upgrade from ZC 1.3.x to 1.5.4 (Image Handler is v. 4) Used to be able to upload any size images.

Once the above issue happens we have to delete the record and start over with the product info.

**Anyone else experience this? Any ideas to look at? **
Thanks.

3 Oct 2015, 5:42 PM
#1431
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

eyeb:

Hello. Zen Cart 1.5.4 - Issue with Larger Image Upload
Anytime we upload an image larger than 2700 pixels (there-abouts) the admin page for Image Handler breaks in 1/2 - if you view source the code literally stops 1/2 way down the page...the last line of code in the source is:
<td class="dataTableContent" align="center" valign="top">

And you can't upload anymore images - there is not button to add more. It seems if you upload an image smaller than 2700 px wide we are fine.

We recently upgraded the site - new theme - upgrade from ZC 1.3.x to 1.5.4 (Image Handler is v. 4) Used to be able to upload any size images.

Once the above issue happens we have to delete the record and start over with the product info.

**Anyone else experience this? Any ideas to look at? **
Thanks.

Yeah, have seen it though where I've seen it the limit was much smaller...if not mistaken there's a thread or two out there about this, but basically it's a limit posed by the graphical sizing software not by IH4 itself... IH4 just happens to show the effect. Also, I think that there is some commenting out of code that might allow everything to progress as "normal" but that detail is covered elsewhere than this particular post. Long and short of it is while requested to provide the largest/highest quality image as possible, there still is an upper limit to everything...

7 Oct 2015, 8:49 PM
#1432
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

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

OK, this is driving me nuts because I can't narrow down the cause.

I have a test site up (here)

The product image on the left (all are missing but 1) is showing in the browser as 100 pixels wide. I can't quite figure out why that is, but that's not what I'm here to ask. The NATIVE size of the image is 250 x 103 and I can't figure out for the life of me where that's coming from! The actual size of the original image is 3x that (750 x 311). The image src is in the bmz_cache/8/ folder but how's it get there? I have NO setting (that I can find) sizing anything to 250px wide and/or 103px tall, or "1 third" or anything like that.

I assumed for that page that the setting should be "Image - Product Listing Width/Height", which I have set to 100 and 100! respectively. Yet it keeps generating this 250*103 image. It has to be IH doing it, right? THat's why it is in that folder?

Incidentally, I changed that setting to something else but there's no effect on the page... no matter what, I get it showing as 100px wide with a native width of 250px.

HELP!

7 Oct 2015, 9:18 PM
#1433
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

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

I uploaded a 2nd image... this time the original image is 712960. I still have the image set to resize to 100100!. For this case, however, on that page it shows as 100135 with a native size of 212286. This time not exactly 1/3, so maybe that was a coincidence... but still, where in the world is this random resizing coming from???

Isn't the whole point of IH to automatically resize to the WANTED size, not some weird in-between size so the browser still has to smoosh it?

7 Oct 2015, 9:30 PM
#1434
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

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

Nevermind.... it seems like its some stupid hardcoding in the template I bought.

8 Dec 2015, 5:29 PM
#1435
twdhosting avatar

twdhosting

Zen Follower

Join Date:
Mar 2005
Posts:
119
Plugin Contributions:
0

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

Just a quick question - IH works great and the caching speeds up a website dramtically BUT is there a way of changing the horrible random filenames so that they are the same as the original image? SEO wise it's quite important to have good keywords in image names... At the moment the filenames are all "/bmz_cache/dfhkfh8y770FBDFD F.jpg" etc

8 Dec 2015, 5:36 PM
#1436
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

twdhosting:

Just a quick question - IH works great and the caching speeds up a website dramtically BUT is there a way of changing the horrible random filenames so that they are the same as the original image? SEO wise it's quite important to have good keywords in image names... At the moment the filenames are all "/bmz_cache/dfhkfh8y770FBDFD F.jpg" etc

Please take an opportunity to peruse this forum back even a few pages. Will see that there is a version on gihtub that incorporates the above request. It has not fully gone through testing, so the use is at your own risk (beta version last time I checked).

8 Dec 2015, 5:43 PM
#1437
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

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

I don't think the image file name matters squat for SEO and if anyone tells you otherwise they're spouting out more than they can possibly know since the search engines NEVER publish their ranking criteria.

Sometimes evidence is... well... the best evidence.

Seaching for "ball", the #1 hit has a file name called 751_multi.jpg. Too abstract? The number one hit for "Britney Spears" is an image named NUw8J0T5.jpg.

I know I hate more than anyone when someone posts a bad answer to my question, so officially my answer is "don't know"... but my advice, which you didn't ask for, is to not worry about it. SEO as a whole is strange in my opinion as Google has always done the same thing which is to ignore or even punish attempts to manipulate rankings in favor of delivering viewers the best CONTENT.

10 Dec 2015, 6:09 AM
#1438
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

twdhosting:

Just a quick question - IH works great and the caching speeds up a website dramtically BUT is there a way of changing the horrible random filenames so that they are the same as the original image? SEO wise it's quite important to have good keywords in image names... At the moment the filenames are all "/bmz_cache/dfhkfh8y770FBDFD F.jpg" etc

mc12345678:

Please take an opportunity to peruse this forum back even a few pages. Will see that there is a version on gihtub that incorporates the above request. It has not fully gone through testing, so the use is at your own risk (beta version last time I checked).

s_mack:

I don't think the image file name matters squat for SEO and if anyone tells you otherwise they're spouting out more than they can possibly know since the search engines NEVER publish their ranking criteria.

Sometimes evidence is... well... the best evidence.

Seaching for "ball", the #1 hit has a file name called 751_multi.jpg. Too abstract? The number one hit for "Britney Spears" is an image named NUw8J0T5.jpg.

I know I hate more than anyone when someone posts a bad answer to my question, so officially my answer is "don't know"... but my advice, which you didn't ask for, is to not worry about it. SEO as a whole is strange in my opinion as Google has always done the same thing which is to ignore or even punish attempts to manipulate rankings in favor of delivering viewers the best CONTENT.

I agree with s_mack.. Let me add something.. The changes to image naming in the beta version of Image Handler available on Github wasn't done for SEO at all.. As IH has been around for a LONG time, I think that this longevity alone has more than disproved any SEO file naming myths.. The change to the naming convention in the beta version of IH4 (on Github) was done simply to help shop owners identify CLEARLY images in the cache.. SEO wasn't even a consideration..

10 Dec 2015, 2:09 PM
#1439
feznizzle avatar

feznizzle

Totally Zenned

Join Date:
Apr 2010
Posts:
900
Plugin Contributions:
0

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

Woah, twdhosting!!! Easy with the salty language, buddy. Using words like 'SEO' or 'keywords' up here??? :shocking:

Keep it up and somebody is likely to wash that filthy mouth out with soap! :D

So… I'm guessing you create subdirectories in your image folder. And the names of the sub-directories not only help you track which images are where, but those subfolder names are excellent descriptions of the images below. And you wish SE's would notice them. So it bothers you that IH removes them from the image's url?

That used to bother me, too. But then I noticed that my images do very well on SE searches, often appearing at the top of google image searches.

My guess is that this happens for 3 reasons:

  1. SE automatically associates my image w/ keywords from content on page where image exists (i.e. prod/category page).
  2. I use the mod Sitemap XML. When it lists a page, it automatically adds the associated image.
  3. Content, content, content! If your content is good, the SE bot will find it's own keywords and associate them with your image.
    I get that you wish your folder names would also show up, as they would if IH used the 'natural' structure to create URL (/images/cars/sedans/honda/accord.jpeg = keywords: "cars, sedans, honda, accord"). I would like that, too. Perhaps it wouldn't help, but it certainly wouldn't hurt.

Honestly though, I don't think it matters much. Not enough to warrant using the Beta version (unless you plan to help test that version).

To optimize your site for SE, first give them what the want. The following is a list no one will argue with (maybe?):

  • XML Sitemap
  • Provide a good user experience
  • Valid code
  • Fast site <--- IH is awesome for this!
  • Excellent, well organized content, content, CONTENT!
    To load your URL's, focus on pages other than your images by installing a rewrite mod (I favor CEON).

Bottom line, IH rocks! It's my second favorite mod (first being DrByte's Backup MySQL)! Benefits gained using IH and bmz_cache far, far outweighs any minor keyword opportunity loss.

+++
NOTE TO MOD: I know SEO is not pertinent to IH4 support. I just wanted to point out that even though IH4 has no intention to effect SEO, it inadvertently does. And in a very positive way, primarily by slimming files and decreasing load time.

10 Dec 2015, 2:31 PM
#1440
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

Feznizzle:

Not enough to warrant using the Beta version (unless you plan to help test that version).

You may not know this, but the "beta" version has been being "tested" for a few years now.. (in use on ALL of my client's websites) It's only labeled "beta" because this version only exists in my Github repo and I have not yet submitted it to the downloads yet.. (just haven't had time) If the OP really wants his IH4 image cache files to be based on the uploaded image name and to NOT use the MD5 hash code, I ENCOURAGE him to install the "beta" version of IH4..

https://github.com/DivaVocals/zen_Image-Handler