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
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
Yeh i think that would be a good idea then for people who have larger images to show this wouldnt be an issue!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.
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..
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..
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.
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.
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:
3. BEFORE, ADD:
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
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;
Code: Select all
if (!$width || !$height) {
list($width, $height) = getimagesize(DIR_IMAGE . $filename);
}
You may need to clear your image cache folder if you aren't seeing immediate results
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
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
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:
Even tho my image is set to 500x500 the width and height is 406x406
Same with 700x700
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
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">
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've changed the popup thumb size in "settings" to x and it gives me a whole bunch of errors.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:Even tho my image is set to 500x500 the width and height is 406x406Code: Select all
<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-500x500.jpg" id="TB_Image">
Same with 700x700I 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 discontinuedCode: Select all
<img width="406" height="406" alt="" src="http://localhost/v144/image/cache/data/apple_cinema_30-700x700.jpg" id="TB_Image">
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?
Yeah!Qphoria wrote:did you make the code change in the image.php file?
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;
}
}
?>
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
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
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
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
Who is online
Users browsing this forum: No registered users and 310 guests