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

Results 821 to 840 of 1,691
23 Aug 2013, 6:59 PM
#821
divavocals avatar

divavocals

Totally Zenned

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

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

DivaVocals:

Okay.. My apologies.. I think the popup issue on the EyeItalia site is unrelated to IH4, and may be a javascript conflict coming from my responsive template.. Standby.. Gonna try your new code on the client site where I first spotted the initial popup problem..

and..... drumroll please...

IT WORKS!!!

mc12345678 - YOU ARE THE MAN!!!! (I can't tell your gender by your screenname.. :laugh:)

Okay.. my apologies to mc12345678 for the last 5 pages of this thread.. It wasn't until you last post that it finally clicked that my responsive template is the cause of the popup window issue.. Probably a javascript conflict.. when I turned off the responsive template, the issue went away..

I just installed the modified additional_images.php module file on my client's live site (where I first discovered the issue) and BOBS YOUR UNCLE.... IT worked!!!

Before I package this up and submit it as an update, we do need others with the ORIGINAL issue ("no image" product image was displaying in the large image popup), to test and report their findings..

Working here: http://www(dot)consciousink(dot)com/assortment-series-p-112.html

23 Aug 2013, 7:00 PM
#822
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

mc12345678:

Diva has already replied; however, would like to say that there is no reason that the files would need to be uploaded one by one. This site identifies at least two ftp applications (names I can not remember at moment) that will upload each file until completion and it is possible to identify all files to be uploaded at once, and it/they will do so. Ie. there are many ftp programs that will hang and basically dump the file(s) or cause other issues with the uploads.

I do recall that I have experienced something similar before as well, though, but couldn't tell you the exact conditions that were in place. What happens if you upload that picture in the standard product entry location such as from the admin panel? The same thing, or do you see results that you were expecting?

Given the issue EHSI is having I still suggest a rollback and re-install..

23 Aug 2013, 7:08 PM
#823
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

DivaVocals:

and..... drumroll please...

IT WORKS!!!

mc12345678 - YOU ARE THE MAN!!!! (I can't tell your gender by your screenname.. :laugh:)

Okay.. my apologies to mc12345678 for the last 5 pages of this thread.. It wasn't until you last post that it finally clicked that my responsive template is the cause of the popup window issue.. Probably a javascript conflict.. when I turned off the responsive template, the issue went away..

I just installed the modified additional_images.php module file on my client's live site (where I first discovered the issue) and BOBS YOUR UNCLE.... IT worked!!!

Before I package this up and submit it as an update, we do need others with the ORIGINAL issue ("no image" product image was displaying in the large image popup), to test and report their findings..

Working here: http://www(dot)consciousink(dot)com/assortment-series-p-112.html
I need to add that I remember reporting to ckosloff that the additional images were an issue when IH was updated for 1.3.9.. I also remember that he and had a bit of back and forth on the matter because he didn't think that what I was reporting was an issue.. That is part of the reason the large image popup got rolled back to an old version from a prior version of Zen Cart to begin with.. I had NO IDEA at the time that this would leave the image popups subject to XSS vulnerabilities.. I just knew that the popups and additional images were not working correctly, and I thought I found a solution..

Anyway.. mc12345678 again.. thanks for your tenacity, and patience.. :smile:

23 Aug 2013, 7:12 PM
#824
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

DivaVocals:

Given the issue EHSI is having I still suggest a rollback and re-install..

nodding head in agreement but was curious if the system responds differently based on "where" the image is input. Hopefully/expectedly after the reinstall it will work as foreseen, but at least then EHSI will have a deeper understanding of how it all fits together and works.

I did agree to the reinstall right? :) good luck.

23 Aug 2013, 7:38 PM
#825
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

DivaVocals:

I need to add that I remember reporting to ckosloff that the additional images were an issue when IH was updated for 1.3.9.. I also remember that he and had a bit of back and forth on the matter because he didn't think that what I was reporting was an issue.. That is part of the reason the large image popup got rolled back to an old version from a prior version of Zen Cart to begin with.. I had NO IDEA at the time that this would leave the image popups subject to XSS vulnerabilities.. I just knew that the popups and additional images were not working correctly, and I thought I found a solution..

Anyway.. mc12345678 again.. thanks for your tenacity, and patience.. :smile:

Quite welcome, not to say that I didn't have a vested interest in resolving it. :) Thanks for reaching out for assistance.

23 Aug 2013, 8:02 PM
#826
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

mc12345678:

Quite welcome, not to say that I didn't have a vested interest in resolving it. :) Thanks for reaching out for assistance.No seriously.. NO WAY I would have ever been able to fix this.. NEVER!!! Thanks soooooo much!! NOW I am going to go get some lunch!!!

23 Aug 2013, 8:22 PM
#827
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

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

Ok, I see all the excitement that it now works. I just don't follow what needs to be done to make it function properly? Can you recap on what you found and what "fix" we need to apply? Thanks.

23 Aug 2013, 8:30 PM
#828
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

mydanilo:

Ok, I see all the excitement that it now works. I just don't follow what needs to be done to make it function properly? Can you recap on what you found and what "fix" we need to apply? Thanks.

All I would do is search through the post to write up a recap anyway.. So I'm gonna respectfully ask you to go back through the post..I'm on a mobile device right now (at a restaurant), and recapping things including the code on this tiny device will not be easy.. I promise the required changes are QUITE easy to follow.. The code changes is posted around page 78 or 79..

23 Aug 2013, 8:44 PM
#829
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

DivaVocals:

No seriously.. NO WAY I would have ever been able to fix this.. NEVER!!! Thanks soooooo much!! NOW I am going to go get some lunch!!!

Well, you probably should get some rest too. I saw you were awake a long time. :P

23 Aug 2013, 9:00 PM
#830
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

mydanilo:

Ok, I see all the excitement that it now works. I just don't follow what needs to be done to make it function properly? Can you recap on what you found and what "fix" we need to apply? Thanks.

The code originally posted and seeming to work is provided here below and at the associated link:

mc12345678:

So here is the code that works for the includes/modules/YOUR_TEMPLATE/additional_images.php:

for ($i=0, $n=$num_images; $i<$n; $i++) {
$file = $images_array[$i];
$products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
// Begin Image Handler changes 1 of 2
//next line is commented out for Image Handler
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
list($src, $alt, $width, $height, $parameters) = $newimg;

$products_image_large = zen_output_string($src);
}

$flag_has_large = file_exists($products_image_large);
// End Image Handler changes 1 of 2

> 
> To be coupled with the following code in the includes/templates/YOUR_TEMPLATE/popup_image_additional/tpl_main_page.php file:
> 
> ```
<?php
/**mod Image Handler 4.1
 * Override Template for common/tpl_main_page.php
 *
 * @package templateSystem
 * @copyright Copyright 2005-2006 Tim Kroeger
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_main_page.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
 */
?>
<body id="popupAdditionalImage" class="centeredContent" onload="resize();">
<div>
<?php
// $products_values->fields['products_image']
//Begin Image Handler changes 1 of 2
//the next line is commented out for Image Handler 3
  if (file_exists($_GET['products_image_large_additional'])) {
//End Image Handler changes 1 of 2
  echo '<a href="javascript:window.close()">' . zen_image($_GET['products_image_large_additional'], $products_values->fields['products_name'] . ' ' . TEXT_CLOSE_WINDOW) . '</a>';
//Begin Image Handler changes 2 of 2
//the next three lines are commented out for Image Handler 3
  } else {
    echo '<a href="javascript:window.close()">' . zen_image(DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, POPUP_ADDITIONAL_NO_IMAGE . ' ' . TEXT_CLOSE_WINDOW) . '</a>'; /*v4.3.1c-lat9*/ 
  }
//End Image Handler changes 2 of 2
?>
</div>
</body>

The above code does a check for the existence of the file on the server, and goes to present an image which if the image path is wrong/a non-image on the server, would not display anything as indicated by Dr. Byte if I understood correctly.

23 Aug 2013, 9:08 PM
#831
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

mc12345678:

Well, you probably should get some rest too. I saw you were awake a long time. :P

I was!!!! But first I gotta eat!!!

23 Aug 2013, 9:15 PM
#832
mydanilo avatar

mydanilo

Totally Zenned

Join Date:
Dec 2004
Posts:
1,024
Plugin Contributions:
0

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

Awesome! @mc1234567 thank you for consolidating the current solution. I'll implement over the weekend.

23 Aug 2013, 9:46 PM
#833
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

mydanilo:

Awesome! @mc1234567 thank you for consolidating the current solution. I'll implement over the weekend.

Wasn't anything to "consolidate" really.. simply some changes that needed to be made to the additional_images.php file to work properly with the new
tpl_main_page.php popup code included in the current IH4 fileset.. and FYI, you need to include the fix to the popup code that torvista posted earlier..

24 Aug 2013, 3:37 AM
#834
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

mc12345678:

The code originally posted and seeming to work is provided here below and at the associated link:

There is a small issue.. I'm getting errors coming from the additional_images.php.. Here's what the logs say:

[23-Aug-2013 20:32:35 America/Phoenix] PHP Warning: Missing argument 5 for handle_image(), called in /xxxx/xxxxxx/xxxxxxxx/html/includes/modules/theme298/additional_images.php on line 86 and defined in /xxxx/xxxxxx/xxxxxxxx/html/includes/functions/extra_functions/functions_bmz_image_handler.php on line 51
Line 86 reads:

        $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
24 Aug 2013, 4:01 AM
#835
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

DivaVocals:

There is a small issue.. I'm getting errors coming from the additional_images.php.. Here's what the logs say:

Line 86 reads:

    $newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);

That's a shame that it throughs an error considering it has a default value. Don't know if it might be a specfic php version thing or not, but should be able to put a comma after the height assignment. If still get errors, then , '' (comma and two single quotes.)

So close. :P
24 Aug 2013, 4:13 AM
#836
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

mc12345678:

That's a shame that it throughs an error considering it has a default value. Don't know if it might be a specfic php version thing or not, but should be able to put a comma after the height assignment. If still get errors, then , '' (comma and two single quotes.)

So close. :P
Ummmmm yeah.. :laugh:

Can ya SHOW me what the line SHOULD look like..

24 Aug 2013, 4:42 AM
#837
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

DivaVocals:

Ummmmm yeah.. :laugh:

Can ya SHOW me what the line SHOULD look like..
So probably the most stable and programmer assigned version would be as below (provided again as a unit to minimize searching for the latest):

[QUOTE=mc12345678;1215719]So here is the code that works for the includes/modules/YOUR_TEMPLATE/additional_images.php:

  for ($i=0, $n=$num_images; $i<$n; $i++) {
    $file = $images_array[$i];
    $products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
//  Begin Image Handler changes 1 of 2
//next line is commented out for Image Handler
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
list($src, $alt, $width, $height, $parameters) = $newimg;

$products_image_large = zen_output_string($src);
} 

$flag_has_large = file_exists($products_image_large);
//  End Image Handler changes 1 of 2

To be coupled with the following code in the includes/templates/YOUR_TEMPLATE/popup_image_additional/tpl_main_page.php file:

<?php
/**mod Image Handler 4.1
 * Override Template for common/tpl_main_page.php
 *
 * @package templateSystem
 * @copyright Copyright 2005-2006 Tim Kroeger
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_main_page.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
 */
?>
<body id="popupAdditionalImage" class="centeredContent" onload="resize();">
<div>
<?php
// $products_values->fields['products_image']
//Begin Image Handler changes 1 of 2
//the next line is commented out for Image Handler 3
  if (file_exists($_GET['products_image_large_additional'])) {
//End Image Handler changes 1 of 2
  echo '<a href="javascript:window.close()">' . zen_image($_GET['products_image_large_additional'], $products_values->fields['products_name'] . ' ' . TEXT_CLOSE_WINDOW) . '</a>';
//Begin Image Handler changes 2 of 2
//the next three lines are commented out for Image Handler 3
  } else {
    echo '<a href="javascript:window.close()">' . zen_image(DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, POPUP_ADDITIONAL_NO_IMAGE . ' ' . TEXT_CLOSE_WINDOW) . '</a>'; /*v4.3.1c-lat9*/ 
  }
//End Image Handler changes 2 of 2
?>
</div>
</body>
24 Aug 2013, 5:52 AM
#838
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

mc12345678:

So probably the most stable and programmer assigned version would be as below (provided again as a unit to minimize searching for the latest):

mc12345678:

So here is the code that works for the includes/modules/YOUR_TEMPLATE/additional_images.php:

for ($i=0, $n=$num_images; $i<$n; $i++) {
$file = $images_array[$i];
$products_image_large = str_replace(DIR_WS_IMAGES, DIR_WS_IMAGES . 'large/', $products_image_directory) . str_replace($products_image_extension, '', $file) . IMAGE_SUFFIX_LARGE . $products_image_extension;
// Begin Image Handler changes 1 of 2
//next line is commented out for Image Handler
if (function_exists('handle_image')) {
$newimg = handle_image($products_image_large, addslashes($products_name), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, '');
list($src, $alt, $width, $height, $parameters) = $newimg;

$products_image_large = zen_output_string($src);
}

$flag_has_large = file_exists($products_image_large);
// End Image Handler changes 1 of 2

> 
> To be coupled with the following code in the includes/templates/YOUR_TEMPLATE/popup_image_additional/tpl_main_page.php file:
> 
> ```
<?php
/**mod Image Handler 4.1
 * Override Template for common/tpl_main_page.php
 *
 * @package templateSystem
 * @copyright Copyright 2005-2006 Tim Kroeger
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_main_page.php,v 2.0 Rev 8 2010-05-31 23:46:5 DerManoMann Exp $
 */
?>
<body id="popupAdditionalImage" class="centeredContent" onload="resize();">
<div>
<?php
// $products_values->fields['products_image']
//Begin Image Handler changes 1 of 2
//the next line is commented out for Image Handler 3
  if (file_exists($_GET['products_image_large_additional'])) {
//End Image Handler changes 1 of 2
  echo '<a href="javascript:window.close()">' . zen_image($_GET['products_image_large_additional'], $products_values->fields['products_name'] . ' ' . TEXT_CLOSE_WINDOW) . '</a>';
//Begin Image Handler changes 2 of 2
//the next three lines are commented out for Image Handler 3
  } else {
    echo '<a href="javascript:window.close()">' . zen_image(DIR_WS_IMAGES . PRODUCTS_IMAGE_NO_IMAGE, POPUP_ADDITIONAL_NO_IMAGE . ' ' . TEXT_CLOSE_WINDOW) . '</a>'; /*v4.3.1c-lat9*/ 
  }
//End Image Handler changes 2 of 2
?>
</div>
</body>

Sorry for the late response.. I was out having dinner.. :smile:

This worked.. No more errors.. The line highlighted in blue is the only change I made.. The line highlighted in red needs Torvista's changes applied though..

24 Aug 2013, 4:09 PM
#839
ehsi avatar

ehsi

New Zenner

Join Date:
Aug 2013
Posts:
49
Plugin Contributions:
0

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

DivaVocals:

Given the issue EHSI is having I still suggest a rollback and re-install..

Good morning,

I rolled back to the original installation of ZC with only my custom template added to ZC files. Then I installed IH4 transferring it file by file to the server and I received a message that the installation of IH4 was successful. I proceeded then to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.

Having no success with ZC + custom template installation, I installed ZC without my template and then uploaded IH4 (file by file) to the server. The current installation is http://www.augustica.com/Store/index.php the plane ZC with IH4. I tried to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.

I have no idea what is wrong. It is obviously my fault since I have seen IH4 to re size my image(s) when I installed it the first time several days ago. I just cannot pinpoint the problem.

I need some help here and some extra eyes and brains to figure this one out.

Thank you.

24 Aug 2013, 4:16 PM
#840
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

EHSI:

Good morning,

I rolled back to the original installation of ZC with only my custom template added to ZC files. Then I installed IH4 transferring it file by file to the server and I received a message that the installation of IH4 was successful. I proceeded then to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.

Having no success with ZC + custom template installation, I installed ZC without my template and then uploaded IH4 (file by file) to the server. The current installation is http://www.augustica.com/Store/index.php the plane ZC with IH4. I tried to upload my default image with the size of 191K. The IH4 uploaded the image and made all three images (small, medium, and large) to be of the same size 191K.

I have no idea what is wrong. It is obviously my fault since I have seen IH4 to re size my image(s) when I installed it the first time several days ago. I just cannot pinpoint the problem.

I need some help here and some extra eyes and brains to figure this one out.

Thank you.

Have you tried in the catalog to upload your picture then go into IH4 to see the results? Or gone into the IH4 admin to reset/clear the bmz cache? (I forget what the specific action title is, but it is to clear the IH4 images and then they get recreated?) Or tried using the site to see if the images get updated and then check the IH4 results again?