Post by grantdp » Tue Mar 30, 2010 9:17 pm

Hi,

Ive had a search and havent found anything for the 1.4x versions.

I'm looking to disable the auto resize of the image popups and just display the original and if anyone has done it?

As i have some large images like 700px X 1000px.

Many Thanks
Grant

New member

Posts

Joined
Fri Apr 03, 2009 7:44 am

Post by baran » Thu Apr 01, 2010 2:51 am

Go to admin side, then under the "system/manage store then under action click the "edit" button. A new page will appear on that page click the "image" tab..

From that page you can change all image sizes.

Hope that helps you.

New member

Posts

Joined
Wed Mar 17, 2010 9:33 pm

Post by grantdp » Thu Apr 01, 2010 3:07 am

Hi baran,

no thats not what im looking for, im tryin to disable the image resize completely so the popup will show the original image size.

Thanks Anyway.

Grant.

New member

Posts

Joined
Fri Apr 03, 2009 7:44 am

Post by Qphoria » Thu Apr 01, 2010 3:40 am

Maybe the image class should be changed to do that that. If you leave the size blank, then use the default image size.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by grantdp » Thu Apr 01, 2010 7:36 am

Qphoria wrote:Maybe the image class should be changed to do that that. If you leave the size blank, then use the default image size.
Yeh i think that would be a good idea then for people who have larger images to show this wouldnt be an issue!

New member

Posts

Joined
Fri Apr 03, 2009 7:44 am

Post by hubba » Thu Apr 01, 2010 12:09 pm

I have went to the settings and blank out the image pop up size field when I test it in the store , it gives me error alot of errors.

How do I go about making this work properly? I would prefer the pop up image size to show the actual picture size as well..

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by Qphoria » Thu Apr 01, 2010 1:04 pm

hubba wrote:I have went to the settings and blank out the image pop up size field when I test it in the store , it gives me error alot of errors.
As I said, it is maybe something that "Should" be done. It does not work like this now

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hubba » Thu Apr 01, 2010 1:23 pm

Ah okay.

I have searh futher in the forum and I come across this post : http://forum.opencart.com/viewtopic.php ... ilit=popup

I did according to what was mentioned ( step 1 and step 2). I know the resizing has been stopped. It is getting the pop up pictures from the actual pictures itself and not from the cache folder but the popup image size still look the same as before.

maybe I'll try to view the site with some free proxy sites to see if I get the same behaviour or not.

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by Qphoria » Thu Apr 01, 2010 1:34 pm

It is simple to add:


In 1.4.4 or newer
1a. EDIT: catalog/model/tool/image.php

In 1.3.4 or 1.4.0
1b. EDIT: system/helper/image.php

2. FIND:

Code: Select all

$old_image = $filename;
3. BEFORE, ADD:

Code: Select all

if (!$width || !$height) {
	list($width, $height) = getimagesize(DIR_IMAGE . $filename); 
}
Then just change the size to a letter like "x" to fool the verification system since it requires a positive integer. The db will try to write an integer and convert the letter to 0 which is what we want

You may need to clear your image cache folder if you aren't seeing immediate results

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hubba » Thu Apr 01, 2010 1:40 pm

yeah other proxy gave me the same behaviour.. I wonder if I need to change the jcarosol or thinkbox css files.

ok Q, I will go and revert back the changes I have done to stop the resizing.. and try your approach.

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by hubba » Thu Apr 01, 2010 1:49 pm

Reverted the changes and used Q's approached. blasted off my image cache as well..

but still the same behaviour.

Hey Q, do you mean to say that I should add your approach on top of what I have done to stop the resize?

The two products that I am testing the behavour are:
http://www.handmadegrips.com/luger-grips-lu66
http://www.handmadegrips.com/colt-1911-grips-aco11

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by Qphoria » Thu Apr 01, 2010 7:45 pm

Well my fix works at the image level. If you leave things like product thumb set to x then you will see the default image size

But the popup has 2 controllers
1 - The popup size in admin
2 - The thickbox auto-size

If you have firebug you can inspect the thickbox popup and see:

Code: Select all

<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-500x500.jpg" id="TB_Image">
Even tho my image is set to 500x500 the width and height is 406x406

Same with 700x700

Code: Select all

<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-700x700.jpg" id="TB_Image">
I looked at the thickbox code briefly and it seems to be doing additional calculations based on pagesize and other coords so it is limiting the max size. I guess that is why thickbox was discontinued

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hubba » Thu Apr 01, 2010 8:05 pm

Qphoria wrote:Well my fix works at the image level. If you leave things like product thumb set to x then you will see the default image size

But the popup has 2 controllers
1 - The popup size in admin
2 - The thickbox auto-size

If you have firebug you can inspect the thickbox popup and see:

Code: Select all

<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-500x500.jpg" id="TB_Image">
Even tho my image is set to 500x500 the width and height is 406x406

Same with 700x700

Code: Select all

<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-700x700.jpg" id="TB_Image">
I looked at the thickbox code briefly and it seems to be doing additional calculations based on pagesize and other coords so it is limiting the max size. I guess that is why thickbox was discontinued
I've changed the popup thumb size in "settings" to x and it gives me a whole bunch of errors.

Warning: imagecreatetruecolor() [function.imagecreatetruecolor]: Invalid image dimensions in xxxxxx/xxxxxx/public_html/system/library/image.php on line 73Warning: imagecolorallocate(): supplied argument is not a valid Image resource in xxxxxx/xxxxxx/public_html/system/library/image.php on line 75Warning: imagefilledrectangle(): supplied argument is not a valid Image resource in xxxxxx/xxxxxx/public_html/system/library/image.php on line 76Warning: imagecopyresampled(): supplied argument is not a valid Image resource in xxxxxx/xxxxxx/public_html/system/library/image.php on line 78Warning: imagejpeg(): supplied argument is not a valid Image resource in xxxxxx/xxxxxx/public_html/system/library/image.php on line 43Warning: imagedestroy(): supplied argument is not a valid Image resource in xxxxxx/xxxxxx/public_html/system/library/image.php on line 50


Did I set it in the wrong place?

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by Qphoria » Thu Apr 01, 2010 9:45 pm

did you make the code change in the image.php file?

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by hubba » Thu Apr 01, 2010 9:51 pm

Qphoria wrote:did you make the code change in the image.php file?
Yeah!

Code: Select all

<?php
function image_resize($filename, $width, $height) {
	if (!file_exists(DIR_IMAGE . $filename)) {
		return;
	} 
	
	if (!$width || !$height) {
      list($width, $height) = getimagesize(DIR_IMAGE . $filename); 
   }	
$old_image = $filename;
	$new_image = 'cache/' . substr($filename, 0, strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.jpg';
	
	if (!file_exists(DIR_IMAGE . $new_image) || (filemtime(DIR_IMAGE . $old_image) > filemtime(DIR_IMAGE . $new_image))) {
		$image = new Image(DIR_IMAGE . $old_image);
		$image->resize($width, $height);
		$image->save(DIR_IMAGE . $new_image);
	}

	if (isset($_SERVER['HTTPS']) && (($_SERVER['HTTPS'] == 'on') || ($_SERVER['HTTPS'] == '1'))) {
		return HTTPS_IMAGE . $new_image;
	} else {
		return HTTP_IMAGE . $new_image;
	}	
}
?>

New member

Posts

Joined
Mon Sep 07, 2009 1:13 am

Post by cpsarros » Sat Jan 29, 2011 1:57 pm

I made the changes to the image.php file as stated above and also changed the popup size in admin from 500 to x to fool the db to change it to 0

I was getting the same error as hubba explained

I then went into the database and found 2 entries for popup in the 'setting' table and changed the 'value' to 0 on both the height and width and it worked.

Thanks Q

New member

Posts

Joined
Fri May 14, 2010 3:55 pm

Post by JimW » Fri Jul 13, 2012 8:44 pm

If you set Product Image Popup Size: to x, at least for me it doesn't fool the db into 0, I had to go in the db and change the two x's to 0 which sucks.

I use vqmod:

<file name="catalog/model/tool/image.php">
<operation>
<search position="before"><![CDATA[$old_image = $filename;]]></search>
<add><![CDATA[if ($width > 2000 || $height > 2000) {list($width, $height) = getimagesize(DIR_IMAGE . $filename);}]]></add>
</operation>
</file>

And set Product Image Popup Size: to 2001 x 2001

Duh

Custom Website Design, Website Maintenance, WHMCS/AWBS themes.
Custom Web Design
Website Maintenance - Website Management - Website Updates
Contact US


New member

Posts

Joined
Mon Feb 22, 2010 3:39 am
Who is online

Users browsing this forum: No registered users and 36 guests