Jump to content
Sign in to follow this  
tomjmul

Support thread for the Image Magic contribution

Recommended Posts

Hi there,

 

i have installed im on the store, but having problems as no pics appear. gd is installed, im is working, but can produce/display a thumbnail.

 

take a look at www.rookybooks.com

 

any suggestions?

 

thanks,

 

alex

Share this post


Link to post
Share on other sites

Hello,

 

I'm sorry I started this post somewhere else in the forum and got no replies. So now I'll try posting my query in the correct place.

 

In Image Magic could somebody be so kind and tell me exactly where I must paste the code in html_output.php? whistling.gif

 

Step #6 - In :

 

/catalog/includes/functions/html_output.php

 

replace the entire tep_image() function with...

 

I've been trying a few times with different/all parts of this code but no joy! blush.gif I'm sure many people use this contribution and would just like a simple answer.

 

Thanks! thumbsup.gif

Share this post


Link to post
Share on other sites

Hi,

i installed imagemagic using the readme, when i rigth click on product image i can see the "imagemagic.php" in the url, so it works. But on the client side, i can't see any product picture, do you know what the problem?

 

Thanks,

 

 

koudjo

Share this post


Link to post
Share on other sites

Nobody ?

 

Hi all !

 

Thanks again for that contrib. It works great for me but my apache error log file is full of warnings and notices:

 

PHP Warning: Call-time pass-by-reference has been deprecated - argument passed by values ...

PHP Notice: Undefined variable: page_prefix in /var/www/html/catalog/imagemagic.php on line 168

PHP Notice: Undefined variable: thumbail_size in /var/www/html/catalog/imagemagic.php on line 66

 

I have upgraded today to the latestest version of Image Magic (tried 1.14 and 1.15 version) but the warnings are still there.

 

My config:

 

Linux (CentOS v4.3)

gd 2.0.28

apache 2.0.52 with vhosts

php v5.0.4

mysql 4.1.20

 

Thanks a lot

 

Guillaume

Share this post


Link to post
Share on other sites
Hi,

i installed imagemagic using the readme, when i rigth click on product image i can see the "imagemagic.php" in the url, so it works. But on the client side, i can't see any product picture, do you know what the problem?

 

Thanks,

koudjo

 

ok, i check my install, all is done:

 

-gd is installed (i see it on list of tools/server_info in the admin side)

-replacement text in html_output.php is done like dj07 said to do it

-imagemagic is working because it appears in url of product images

-thumbnails images are created, i see them in "/catalog/thumbnails" directory

 

but product images (generate by "tep_image" function) still don't appear in the client side

 

i guess that "&" in images url aren't interpreted but i'm not shure.

there is an example of url for image "octane_2.jpg":

http://localhost/catalog/imagemagic.php?im...;page=prod_info

 

and the thumbnails associates with is : octane_2.jpg.thumb_prod_infoprod_info_100x25_322020c9c3bddd45a251fc65c2d0e980.jp

g

 

 

Somebody no what is the problem?

 

thanks for all,

Share this post


Link to post
Share on other sites

Ok, I just drop a message here to warn everyone about two facts, here the first one...

 

The base64 encoding used when enciphering the image path should be change with a "URL safe" base64 encoding !

Otherwise, it will make you crazy if you also use mod_rewrite to build path like

/fakeimgdirectory/img-ENCRYPTEDPATH-w-WIDTH-h-HEIGHT-p-PAGENAME

=> imagemagic.php?img=ENCRYPTEDPATH&w=WIDTH&h=HEIGHT&p=PAGENAME

 

I've lost something like 3 to 4 hours trying to understand why SOME of my images wouldn't show up.

The answer is simple : base64_encoded encrypted image path MIGHT contain some special characters like "+", "/" or "=".

mod_rewrite MIGHT or MIGHT NOT urldecode the encrypted image path, hence ENCRYPTEDPATH MIGHT contain end up with a "+" character.

=> The imagemagic.php script WILL shoke on this. Anytime.

 

Solution : quite simple, remplace the calls to base64_encode and base64_decode by calls to these specific functions (source : http://www.php.net/base64_encode )

 

function urlsafe_b64encode($string) {
$data = base64_encode($string);
	// first, perform a base64_encode, THEN, remplace + by -, / by _, = by .
$data = str_replace(array('+','/','='),array('-','_','.'),$data);
return $data;
}

function urlsafe_b64decode($string) {
$data = str_replace(array('-','_','.'),array('+','/','='),$string);
/*  WARNING WARNING - I, Celluloid, commented this.
		Because I absolutely don't know what it does. 
		But may'be you should reconsider, see the original in the comments 
		on this page ....
	   => http://www.php.net/base64_encode */
	/*
	$mod4 = strlen($data) % 4;
if ($mod4) {
	$data .= substr('====', $mod4);
} */
return base64_decode($data);
}

 

Modification in html_output.php

//Encrypt the image filename if switched on
if (CFG_ENCRYPT_FILENAMES == "True" && CFG_ENCRYPTION_KEY !="") {
$result = '';
$key=CFG_ENCRYPTION_KEY;
for($i=0; $i<strlen($src); $i++) {
	$char = substr($src, $i, 1);
	$keychar = substr($key, ($i % strlen($key))-1, 1);
	$char = chr(ord($char)+ord($keychar));
	$result.=$char;
}
// ORIGINAL : $src=urlencode(base64_encode($result));
$src=urlsafe_b64encode($result);
}

You will have noticed that I didn't urlencode the urlsafe_b64encoded $result ...

Why ?

(Source Wikipedia) about base64 encoding :

The only characters used are the upper- and lower-case Roman alphabet characters (A?Z, a?z), the numerals (0?9), and the "+" and "/" symbols, with the "=" symbol as a special suffix code.

So, basically, ANY character string will end up like a character string composed of [A-Z], [a-z], "+", "/" and "=".

"+", "/" and "=" WERE the need for the urlencode.

Since we replace them with "-", "_" and ".", which are "URL safe" there is no need any more of a urlencode...

 

Second modification (you might have figured it out by yourself) lies in imagemagic.php :

//Decrypt the image filename if switched on
if (CFG_ENCRYPT_FILENAMES == "True" && CFG_ENCRYPTION_KEY !="") {
	$result = '';
	$key=CFG_ENCRYPTION_KEY;
	// ORIGINAL : $string = base64_decode($_GET['img']);
			$string = urlsafe_b64decode($_GET['img]);
	for($i=0; $i<strlen($string); $i++) {
		$char = substr($string, $i, 1);
		$keychar = substr($key, ($i % strlen($key))-1, 1);
		$char = chr(ord($char)-ord($keychar));
		$result.=$char;
	}
	$_GET['img']= $result;
}

=> we just replace the call to "base64_decode" by a call to "urlsafe_b64decode".

!!!!!! Just DON'T bother about performing a urldecode. Whether or not you are using mod_rewrite, a urlencoded GET parameter is ALWAYS already urldecoded prior to "entering" the PHP script which "receives" it.

 

Of course, the two functions will have to be declared somewhere in your PHP files.

You can place them above "function tep_image" in html_output.php, and at the start of the file in imagemagic.php ...

Edited by Celluloid

Share this post


Link to post
Share on other sites
Nobody ?

 

Notice and warning are just that ... notices and warning.

The last two you pasted are a simple case of "variable not initiliazed" : PHP is not very strict about variables.

There is not required prior "declaration" (as in C, JAVA, ...) of a variable before its use...

Back in PHP3, there wasn't event the need to set a value to a variable to use it.

BUT if a variable is used in a test condition and has not been set a value before, PHP will issue a notice and create a "blank" variable (whose value will be "" / 0 / false ).

That, is, a "recent" PHP, like yours (PHP5) : the tolerance about the use of unitiliazed variables have greatly changed from PHP3 to PHP4, and from PHP4 to PHP5.

 

To answer your question precisely, the notice about "thumbnail_size" is caused by the (line 60 ... to 70, or something )

switch($thumbnail_size) {
....
}

which is placed after a series of tests to give thumbnail_size a value :

// Get the type of thumbnail we are dealing with
if ( $_GET['w']== SMALL_IMAGE_WIDTH || $_GET['h'] == SMALL_IMAGE_HEIGHT) $thumbnail_size=1;
elseif ($_GET['w'] == HEADING_IMAGE_WIDTH || $_GET['h'] == HEADING_IMAGE_HEIGHT) $thumbnail_size=2;
elseif ($_GET['w'] == SUBCATEGORY_IMAGE_WIDTH || $_GET['h'] == SUBCATEGORY_IMAGE_HEIGHT) $thumbnail_size=3;

if ($_GET['page'] == "prod_info") {
  $thumbnail_size=4;
  $page_prefix = $page ."prod_info_";
}
if ($_GET['page'] == "popup") {
  $thumbnail_size=5;
  $page_prefix = $page ."prod_info_";
}

==> there MIGHT be special cases when the none of the five conditions are met, hence, $thumbnail_size won't have a value yet.

As "$thumbnail_size" is only used for the "switch ... case", you can if you wish, add a

$thumnail_size = 0;

before the series of if(...).

Hence, even if no condition is met, it will have a value (without any consequence for the rest of the script).

 

Same idea about "page_prefix"...

 

But if you don't feel confident, don't try to eliminate the sources of the notice and warning.

The very fact you asked this question means you might not have yet the required level of understanding need to "correct" sources for warning and notices ...

Share this post


Link to post
Share on other sites

Ok, here's the second problem I noticed about this contribution, and this one is serious.

 

If you use the caching functionality of the contribution, DO NOT EVER DELETE THE WHOLE TREE STRUCTURE UNDER your thumbnail cache directory. I SAID : DO NOT EVER.

 

Explanation : I don't know the reason, if it's the << glob("*.*") >> call or something else (well, actually, I do have leads), BUT if you delete the whole tree structure under say YOUR_CATALOG_DIRECTORY/thumbnails/ (/thumnails/image/dvd/[...] etc for ) WHILE someone requests a thumbnail from the online website, AT LEAST ALL THE FILES in YOUR_CATALOG_DIRECTORY WILL BE DELETED.

 

And I'm not joking.

 

So basically :

1) WRITE PROTECT all your files at the base of your OsCommerce installation (those in the /catalog directory) if your thumbnails directory is right below it (ex: /catalog/thumbnails)

Perform same protection at the right place if the location of your thumbnails directory is somewhere else.

 

2) DO NOT EVER perform a MASSIVE DELETE of the tree structure under your thumbnails directory, be it by a shell command (rm -Rf) or a FTP connection

=> if there is THE SLIGHTEST CHANCE that someone's browsing your website and ALL your site files are not WRITE PROTECTED, YOU WILL LOSE SOME.

=> if you have SSH access, once located INSIDE the thumbnails directory, a "find . -type f -name "*" -exec rm {} \;" MIGHT be safer (*)

 

3) If you really like taking risks, perform a SAFE backup of all the files on your website (prefered method : rsync via SSH) BEFORE.

 

4) If anyone has already encounter such problem, drop a message here.

The creator of the mod is welcomed to contribute too ...

May'be there's a way to restrict the glob function call (to image-type files ...) or perform double checks, I don't know, the way I see it, It's due to the fact that

chdir($create_path);

might fail awfully at some point (and we don't know it ...), and hence, the "unlink" calls are performed on the BAD files (that is, files ABOVE the thumbnail cache directory structure).

I think the script should literally bail out on ANY filesystem related error. A broken image on the website is less dramatic than losing php files ... (INCLUDING your index.php)

 

You've been warned :)

 

 

(*) I REALLY think the problem is due to the "loss" of the tree structure (ie: the sub-directories in your thumbnails directory) rather than the "loss" of the files

Edited by Celluloid

Share this post


Link to post
Share on other sites

A very big thank to tomjmul for creating such a great contribution!

This was exactley what I needed. I took a look at some other on the fly thumbnailing countributions but noone of them are so powerful as this one. But I have to say that I have some really touch times to get this contribution to work well.

 

Thank you!

Share this post


Link to post
Share on other sites

Thanks a lot !

U are right i'm a true beginner but i hate warnings :) I will backup my files and try your solutions !

 

Thank u again

Guillaume

 

Notice and warning are just that ... notices and warning.

The last two you pasted are a simple case of "variable not initiliazed" : PHP is not very strict about variables.

There is not required prior "declaration" (as in C, JAVA, ...) of a variable before its use...

Back in PHP3, there wasn't event the need to set a value to a variable to use it.

BUT if a variable is used in a test condition and has not been set a value before, PHP will issue a notice and create a "blank" variable (whose value will be "" / 0 / false ).

That, is, a "recent" PHP, like yours (PHP5) : the tolerance about the use of unitiliazed variables have greatly changed from PHP3 to PHP4, and from PHP4 to PHP5.

 

To answer your question precisely, the notice about "thumbnail_size" is caused by the (line 60 ... to 70, or something )

switch($thumbnail_size) {
....
}

which is placed after a series of tests to give thumbnail_size a value :

// Get the type of thumbnail we are dealing with
if ( $_GET['w']== SMALL_IMAGE_WIDTH || $_GET['h'] == SMALL_IMAGE_HEIGHT) $thumbnail_size=1;
elseif ($_GET['w'] == HEADING_IMAGE_WIDTH || $_GET['h'] == HEADING_IMAGE_HEIGHT) $thumbnail_size=2;
elseif ($_GET['w'] == SUBCATEGORY_IMAGE_WIDTH || $_GET['h'] == SUBCATEGORY_IMAGE_HEIGHT) $thumbnail_size=3;

if ($_GET['page'] == "prod_info") {
  $thumbnail_size=4;
  $page_prefix = $page ."prod_info_";
}
if ($_GET['page'] == "popup") {
  $thumbnail_size=5;
  $page_prefix = $page ."prod_info_";
}

==> there MIGHT be special cases when the none of the five conditions are met, hence, $thumbnail_size won't have a value yet.

As "$thumbnail_size" is only used for the "switch ... case", you can if you wish, add a

$thumnail_size = 0;

before the series of if(...).

Hence, even if no condition is met, it will have a value (without any consequence for the rest of the script).

 

Same idea about "page_prefix"...

 

But if you don't feel confident, don't try to eliminate the sources of the notice and warning.

The very fact you asked this question means you might not have yet the required level of understanding need to "correct" sources for warning and notices ...

Share this post


Link to post
Share on other sites
.....

 

- Is thumbnail folder created?

- Is SAFE MODE is OFF?

- Is DIR_FS_CATALOG path set correctly in configure.php?

- Is thumbnail server caching turned off?

 

Etc.

 

Thanks

 

Jody

THANKYOU!!! I have been searching for ages, this was my answer!!!

 

~bobsi18~

Share this post


Link to post
Share on other sites

Just wanted to supply a solution to a problem that I faced.

 

Everything was being done correctly (thumbnails were being created in the right place and they could be displayed if clicked on locally). The images were stil not showing though.

 

I clicked on the "properties" button for the image (right click on image) and copied and pasted the image URL to a new window. Lo and behold there were "warnings" in the actual image with the image information just below it. Images would not be able to work with this additional text showing (the MIME type is for GIF after all).

 

So I went into my php configuration (php.ini) and i turned the setting "display_errors" to "Off" and did a server restart. Images now all show up :D.

 

I hope this helps someone.

 

Thanks for the great contribution! :thumbsup:

Share this post


Link to post
Share on other sites

Hello.

 

Contribution is great and I installed it many times. But now I got error and do not investigate yet how to fix. Generated images is in very low quality. I do not know why. Sizes of images (width/height) is different. Here is generated image

qqq.jpg

and here is original

B00097E7QC.jpg

 

Thanks for help.

Share this post


Link to post
Share on other sites

great contrib thanks, have tried 2 others for watermarks and they just didnt work - this one does.

 

only problem I had which took me hour or so to work out (I know nothing about coding, just trial and error)

 

is the watermark image and text pull down boxes were empty although the files were there in the correct folders. I dont use the Catalog directory but I checked the code and the config.php on my server and seemed to be fine.

 

in the end I looked at the SQL code to find how that bit worked and see it uses DIR_FS_DOCUMENT_ROOT to reference it

 

So in my admin\includes\configure.php I checked this line and seemed ok. But I tried adding a / to the end of the line in my config file

 

i.e

 

from this

 

define('DIR_FS_DOCUMENT_ROOT','/kunden/homepages/23/d141006650/htdocs/wsb3900560901');

 

to this

 

define('DIR_FS_DOCUMENT_ROOT','/kunden/homepages/23/d141006650/htdocs/wsb3900560901/');

 

then it worked and files were showing up..

 

Im sure it obvious to most, but I thought would point out in case someone else has the same problem.

Share this post


Link to post
Share on other sites

Imagemagick installed without a hitch and it's awesome. I noticed an immediate differnece in loading and image quality...HOWEVER! In the admin section of the site, the admin logo and the online catalog icon do not appear. At first I thought I may have broke something, but when i turn imagemagic off, they show up. Any ideas? has this happened to others? The dimensions are the same as the original pics, so I have no clue what could be causing it. please help as it's rather annoying, and in order to print an invoice with the logo on it, i have to go and turn off image magick to get it to show up.


We must be the change we wish to see in the world.

------------------------------------------------------------

p.s. BACKUP!

Share this post


Link to post
Share on other sites

I got this contribution to work at a store ad than I was going to install it on another store. I got it working until I was going to activate a graphic watermark on the images. I use excetly the same files that I use on my first store so I don't think I find the problem there. Anyone that have the same problem? My problem is that I can't place any watermarks on my images. No graphic or text watermark.

Share this post


Link to post
Share on other sites

Hi all!

 

I have a problem with the sql implementation in phpmyadmin:

I Get #1136 - Column count doesn't match value count at row 1

 

'', 'Watermark Image File', 'WATERMARK_IMAGE', '', 'Select which watermark image you wish to use<br><br>New watermark images may be installed in your:<br><b>/catalog/includes/imagemagic/watermarks/</b><br>directory<br>', 333, 66, NULL , '2005-01-06 20:24:30', NULL

 

So please help me if you can

Share this post


Link to post
Share on other sites
Hi all!

 

I have a problem with the sql implementation in phpmyadmin:

I Get #1136 - Column count doesn't match value count at row 1

 

'', 'Watermark Image File', 'WATERMARK_IMAGE', '', 'Select which watermark image you wish to use<br><br>New watermark images may be installed in your:<br><b>/catalog/includes/imagemagic/watermarks/</b><br>directory<br>', 333, 66, NULL , '2005-01-06 20:24:30', NULL

 

So please help me if you can

 

could you post the entire query, with the insert fields and values, so we can see what is going on?

Share this post


Link to post
Share on other sites

OK... I got it installed - shows up fine under the admin panel, the /thumbnails directory is there, and there are images under it.... but they're not displaying.

 

To note: My store is in the root directory, I do not have a "catalog" directory - however I didn't notice anything under the code that was edited that pointed to a catalog directory.

 

An example of an image link shows as follows:

 

http://www.stevesstash.com/imagemagic.php?...h=100&page=

 

All of the product images are now showing as a broken image.

 

Any ideas how to fix this? :(

Share this post


Link to post
Share on other sites
To note: My store is in the root directory, I do not have a "catalog" directory - however I didn't notice anything under the code that was edited that pointed to a catalog directory.

 

An example of an image link shows as follows:

 

http://www.stevesstash.com/imagemagic.php?...h=100&page=

 

All of the product images are now showing as a broken image.

 

Any ideas how to fix this? :(

 

Had you clicked yourself on the link and you would have had your answer :)

Warning: chdir(): No such file or directory (errno 2) in /home/content/[...]/html/imagemagic.php on line 21

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/[...]/html/imagemagic.php:21) in /home/content/[...]/html/imagemagic.php on line 463

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/[...]/html/imagemagic.php:21) in /home/content/[...]/html/imagemagic.php on line 464

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/[...]/html/imagemagic.php:21) in /home/content/[...]/html/imagemagic.php on line 473

 

Warning: Cannot modify header information - headers already sent by (output started at /home/content/[...]/html/imagemagic.php:21) in /home/content/[...]/html/imagemagic.php on line 181

 

That's basic - basic - basic stuff in PHP :

You have a error linked to the context of execution in your script => error ouput message written to the client (that is, your browser)

Hence, you can't send any more headers.

A header in the context of an HTTP request is a message the server sends to the user (or the user sends to the server) to inform him :

+ of the last time the file he requested was modified

+ of the file-type about to be sent

+ of the location to redirect the request.

+ ... many more

PRIOR to sending any "real" output (things that are displayed in the browser or can be saved to a file or ... whatever).

 

In the case of the ImageMagic contribution, they are many headers that could be sent, depending if you activated "browser-side cache", "server-side cache", etc ...

 

But your image is not broken due to these headers missing. It's broken because of the initial errors and the following errors of the "headers couldn't be sent".

Look here :

Warning: Cannot modify header information - headers already sent by (output started at /home/content/s/s/f/ssforza/html/imagemagic.php:21) in /home/content/s/s/f/ssforza/html/imagemagic.php on line 181
????JFIF??

See the JFIF amongst the weird characters ? It's the beginning of your image.

 

So, get rid of your first error, you'll get rid of the subsequent headers errors, and you'll see the images.

 

Warning: chdir(): No such file or directory (errno 2) in /home/content/[...]/html/imagemagic.php on line 21

=> The script can't make it to a directory, likely because it doesn't exists.

if (file_exists('includes/local/configure.php')) {

//use local dev params if available

include('includes/local/configure.php');

} else {

// include server parameters

require('includes/configure.php');

}

require('includes/imagemagic/imagemagic.functions.php');

chdir (DIR_FS_CATALOG); <==== line 21

 

So, either DIR_FS_CATALOG is not set in your includes/configure.php, either it's set to a wrong value.

I would say it needs to be set to the value of "/home/content/s/s/f/ssforza/html/".

It it's already set to this value, you have a serious problem :D

 

Cheers.

Edited by Celluloid

Share this post


Link to post
Share on other sites
Ok, here's the second problem I noticed about this contribution, and this one is serious.

 

If you use the caching functionality of the contribution, DO NOT EVER DELETE THE WHOLE TREE STRUCTURE UNDER your thumbnail cache directory. I SAID : DO NOT EVER.

 

Explanation : I don't know the reason, if it's the << glob("*.*") >> call or something else (well, actually, I do have leads), BUT if you delete the whole tree structure under say YOUR_CATALOG_DIRECTORY/thumbnails/ (/thumnails/image/dvd/[...] etc for ) WHILE someone requests a thumbnail from the online website, AT LEAST ALL THE FILES in YOUR_CATALOG_DIRECTORY WILL BE DELETED.

 

And I'm not joking.

 

[...]

4) If anyone has already encounter such problem, drop a message here.

The creator of the mod is welcomed to contribute too ...

May'be there's a way to restrict the glob function call (to image-type files ...) or perform double checks, I don't know, the way I see it, It's due to the fact that

chdir($create_path);

might fail awfully at some point (and we don't know it ...), and hence, the "unlink" calls are performed on the BAD files (that is, files ABOVE the thumbnail cache directory structure).

I think the script should literally bail out on ANY filesystem related error. A broken image on the website is less dramatic than losing php files ... (INCLUDING your index.php)

 

You've been warned :)

(*) I REALLY think the problem is due to the "loss" of the tree structure (ie: the sub-directories in your thumbnails directory) rather than the "loss" of the files

 

 

Well, seems like the author is enjoying his summer like every sane people around here...

So basically, if someone here DOES bother about losing all the files in the "catalog" directory, here's the patch :

In imagemagic.php file,

LOOK FOR (inside 'function modify_tn_path($file, $check_cache)')

			//clean up the cache if settings have changed
		if (CFG_CACHE_AUTO_CLEAN=="True" && $check_cache) {
			  $cwd=getcwd();
			  chdir($create_path);
			  foreach (glob("*.*") as $filename) {
					if (!is_dir($filename) && !strstr($filename,$append_hash)) {
						  unlink($filename);
					}
			  }  
			  chdir($cwd);
		}

AND REPLACE BY

			//clean up the cache if settings have changed
		if (CFG_CACHE_AUTO_CLEAN=="True" && $check_cache) {
			  $cwd=getcwd();
			  /* Just be SURE the chdir worked and that you are not STILL in the /catalog/ directory
				  ... or the glob(*.*) will list your index.php file, your product_info.php file, etc
				  and ... you will "unlink" (ie: DELETE) them : 'Woopsie Daisy !!'.
			   */
			  if (chdir($create_path)) {
					foreach (glob("*.*") as $filename) {
						  if (!is_dir($filename) && !strstr($filename,$append_hash)) {
								unlink($filename);
						  }
					}  
					chdir($cwd);
			  }
		}

 

Have fun.

Edited by Celluloid

Share this post


Link to post
Share on other sites

This appears to have been the whole problem - I somehow missed it when I moved my store to the root dir, and it still was pointing to the /catalog directory (yet amazingly everything was working).

Got rid of the /catalog, and the thumbnails appear to be working beautifully now.

 

THANK you :D

 

So, either DIR_FS_CATALOG is not set in your includes/configure.php, either it's set to a wrong value.

I would say it needs to be set to the value of "/home/content/s/s/f/ssforza/html/".

Share this post


Link to post
Share on other sites

hmm.. I think I've come across a minor bug with image magick.

 

so I am running jpegs primarily, and they can get pretty large (for a store). I set my jpeg quality to 60 in the configuration page and loaded up my page then a full size popup image. no problem, it went from 89KB down to 18KB. However everytime after the first load I would do a full refresh (CTRL+SHIFT+R on firefox) the image that would then load would again be >80KB. So I looked at every other image on the site.... and noticed the exact same thing. every time I would load an image the first time (with server caching) it would be super small, and then every time after that it would jump back up in filesize. I finally narrowed it down one by one to find it was the server caching. with server caching turned off, the file sizes always remained the same. with server caching turned on, it would jump down for the first load, then jump back up for subsequent loads.

 

this is happening on jpegs only and I found the problem. around line 178 in catalog/imagemagic.php you have the conditional if you are cached and either a jpeg or gif_as_jpeg. the problem is in this conditional, it basically creates a whole new jpeg out of your cache image at 100 quality. now if you know how JPEG works, you know that 100 quality on a heavily compressed jpeg will increase the size substantially. this doesn't affect the GIF or PNG sections because they are lossless, but with jpeg it creates a larger file. so what I did was I deleted out the imagecreatefromjpeg and imagejpeg calls and after the header() call I put in the following:

 

$push_file = fopen($filename,'r');

while (!feof($push_file)) {

print(fread($push_file, 1024));

flush();

@ob_flush();

}

fclose($push_file);

 

this reads in the actual cached file and outputs it directly to the browser. now technically this is what should happen in the other two conditionals as well. the file stays the same as is in those conditionals, but there is still some processing power involved in reprocessing the images.

 

If this seems off let me know, but this was the only way I could get it to stop processing cached files over and over again. I have left the rest of the module alone and it has worked great. this was the only area that I needed to adjust.

Edited by borghe

Share this post


Link to post
Share on other sites

hi everyone,

 

 

I have installed the contibution v1.15 dated 20 jun 2006, I did all the changes according to the description and still OS does not show pictures. Sorry to post my message, as a lot of people have asked about it before, but I have checked most of the Contribution Support and I could not find any solution for my problem.

 

1. The IM did not create the "Thumbnails" folder so I did it by mysef, changed chmod to 777

2. after that a new folder "Images" has been created insie "Thumbnails" automaticaly (its chmod is 755 and it cannot be changed - if I change it to 777 it still remains 755)

3. if I switch off Cache Thumbnails on the Server in Admin Panel then the contribution starts working, I can add watermarks etc., - but it does not speed up my webpage... because nothing is cached

4. when I check full path of the image (using properties) it shows imagemagic.php in the link

 

5. no matter what I click and change still the folder /thumbnails remains empty.

... even if I try to copy anything to the folder via ftp it seems not to be stored there but automaticaly deleted

 

 

have any ideas??

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×