Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for the Image Magic contribution


tomjmul

Recommended Posts

Does anyone else has the sameproblem that with IE pop-up pictures in -png/tranparancy format does not work right? Atleast mine doeastn open as large as the picture is but much smalle size. :huh:

Edited by aapinen
Link to comment
Share on other sites

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

@ DeadDingo:

 

Iv'e tried your solution but still no succes.

If i go to the map /thumbnails/images, i see the images that are supposed to be seen in my index page but their not shown.

 

Example:

 

My original image is located here: catalog/images

Name of the image:

Carat Trax - Vol 2.jpg

 

When i put the image magic on th image is not shown but if i go to this folder: catalog/thumbnails/images.

That same image is has this name:

Carat Trax - Vol 2.jpg.thumb_111x90_2a86ea884457609e008b8ad65d6d692d.jpg

 

Now are the problems: why can't he show the images and why are only the images of the index in the thumbnails folder?

 

My webshop = www.bougies-records.com

Iv'e disabeld the imagemagic now because i can't see the images.

Edited by bougie
Link to comment
Share on other sites

Just had a look at your site.

 

It might be the scrolling What's New box, but I am not sure.

 

on a side note the page took well over 2 minutes to load for me. OK I am in Japan but I have a dedicated 100MB Fibre connection.

 

I guess it took that long becuase all the images were full size.

 

 

Can you try to rename some of the pics so they do not have spaces in them. Not sure if that would make a differnence or not. But I always try to make sure there are no spaces between the words (I use a - or_ instead)

 

Can you turn the imagemagic on again and post when you have.

 

Cheers

Link to comment
Share on other sites

Just had a look at your site.

 

It might be the scrolling What's New box, but I am not sure.

 

on a side note the page took well over 2 minutes to load for me. OK I am in Japan but I have a dedicated 100MB Fibre connection.

 

I guess it took that long becuase all the images were full size.

Can you try to rename some of the pics so they do not have spaces in them. Not sure if that would make a differnence or not. But I always try to make sure there are no spaces between the words (I use a - or_ instead)

 

Can you turn the imagemagic on again and post when you have.

 

Cheers

 

That's why i want to install this contribution, the page takes too long to load.

It's because of the size of the images.

 

I will try to change names now.

 

Iv'e set the imagemagic on.

 

Friendly greetings

Link to comment
Share on other sites

Iv'e changed the name to: Carat_Trax-Vol_2.jpg

But that doesn't make a diffrence.

 

Something else:

 

I've got the folder thumbnails set to 777 but the folder thumbnails/images i can't set to 777

If i try that the program says:

 

Requested action not taken (e.g., file or directory not found, no access).

 

Is it a problem?

 

Friendly greetings

Edited by bougie
Link to comment
Share on other sites

did you change the entire tep_image() function (/catalog/includes/functions/html_output.php) from this

 

////
// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
$image = '<img src="' . tep_output_string($src) . '" border="0" alt="' . tep_output_string($alt) . '"';

if (tep_not_null($alt)) {
  $image .= ' title=" ' . tep_output_string($alt) . ' "';
}

if ( (CONFIG_CALCULATE_IMAGE_SIZE == 'true') && (empty($width) || empty($height)) ) {
  if ($image_size = @getimagesize($src)) {
	if (empty($width) && tep_not_null($height)) {
	  $ratio = $height / $image_size[1];
	  $width = $image_size[0] * $ratio;
	} elseif (tep_not_null($width) && empty($height)) {
	  $ratio = $width / $image_size[0];
	  $height = $image_size[1] * $ratio;
	} elseif (empty($width) && empty($height)) {
	  $width = $image_size[0];
	  $height = $image_size[1];
	}
  } elseif (IMAGE_REQUIRED == 'false') {
	return false;
  }
}

if (tep_not_null($width) && tep_not_null($height)) {
  $image .= ' width="' . tep_output_string($width) . '" height="' . tep_output_string($height) . '"';
}

if (tep_not_null($parameters)) $image .= ' ' . $parameters;

$image .= '>';

return $image;
 }

 

to this

 

// BOF Image Magic 
function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {  
 global $product_info;

 //Allow for a new intermediate sized thumbnail size to be set 
 //without any changes having to be made to the product_info page itself. 
 //(see the lengths I go to to make your life easier :-)
 if (strstr($_SERVER['PHP_SELF'],"product_info.php")) {

	if (isset($product_info['products_image']) 
			   && $src == DIR_WS_IMAGES . $product_info['products_image']
			   && $product_info[products_id]==$_GET['products_id'])  {   //final check just to make sure that we don't interfere with other contribs
		$width = PRODUCT_INFO_IMAGE_WIDTH == 0?'':PRODUCT_INFO_IMAGE_WIDTH;
		$height = PRODUCT_INFO_IMAGE_HEIGHT == 0?'':PRODUCT_INFO_IMAGE_HEIGHT;
		$product_info_image=true;
		$page="prod_info"; 
	}
 }

 //Detect whether this is a pop-up image
 if (strstr($_SERVER['PHP_SELF'],"popup_image.php")) $page="popup";

 //do we apply the IE PNG alpha transparency fix?
 if  (strstr(strtolower($src),".png") && CFG_PNG_BUG=="True") $fix_png = true;

 //send the image for processing unless told otherwise
 $image = '<img src="' . $src . '"'; //set up the image tag just in case we don't want to process
 if (CFG_MASTER_SWITCH=="On") $calculate = true;
 else $calculate=false;

 // Don't calculate if the image is set to a "%" width
 if (strstr($width,'%') == true || strstr($height,'%') == true) $calculate = false; 

 // Dont calculate if a pixel image is being passed (hope you dont have pixels for sale)
 if (strstr($image, 'pixel')) $calculate = false;


 $image_size = @getimagesize($src);


 // Decide whether or not we want to process this image
 if (($width == '' && $height == '' && $page != 'popup' ) || ($width == $image_size[0] && $height == $image_size[0] && $page != 'popup')) {  
	if (CFG_PROCESS_GRAPHICS=="False") $calculate = false; //looks like this is a store graphic rather than product image
 }	

 // Is this image good to go?
 if (CONFIG_CALCULATE_IMAGE_SIZE && $calculate) { 

 if ($image_size) { 

  $ratio = $image_size[1] / $image_size[0];

  // Set the width and height to the proper ratio
  if (!$width && $height) { 
	$ratio = $height / $image_size[1]; 
	$width = intval($image_size[0] * $ratio); 
  } elseif ($width && !$height) { 
	$ratio = $width / $image_size[0]; 
	$height = intval($image_size[1] * $ratio); 
  } elseif (!$width && !$height && !$over_ride) { 
	$width = $image_size[0]; 
	$height = $image_size[1]; 
  } 

  //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;
		  }
		  $src=urlencode(base64_encode($result));
	}

   //Return the html
	$image = '<img src="imagemagic.php?img='.$src.'&w='.
	tep_output_string($width).'&h='.tep_output_string($height).'&page='.$page.'"';

} elseif (IMAGE_REQUIRED == 'false') { 
  return false; 
} 
 }  

//If the size asked for is greater than the image itself, we check the configs to see if this is allowed and if not over-ride
 if ($width > $image_size[0] || $height > $image_size[1]) {
	if (CFG_ALLOW_LARGER  != 'True'){
		  $width=$image_size[0];
		  $height=$image_size[1];
		  $over_ride = true;
	}
 }
 // Add remaining image parameters if they exist
 if ($width) { 
$image .= ' width="' . tep_output_string($width) . '"'; 
 } 

 if ($height) { 
$image .= ' height="' . tep_output_string($height) . '"'; 
 }	 

 if (tep_not_null($params)) $image .= ' ' . $params;

 $image .= ' border="0" alt="' . tep_output_string($alt) . '"';

 if (tep_not_null($alt)) {
$image .= ' title="' . tep_output_string($alt) . '"';
 }

 if ($fix_png && CFG_MASTER_SWITCH=="On") {
	$image .= ' onload="fixPNG(this)"'; 
 }

 $image .= '>';   
 return $image; 
}
//EOF Image Magic

 

 

Also did you do the database changes?

 

Try using your control panel that the host set up for you (something like CPanel or H-Sphere) in there you will have a file mananger. That should allow you to CHMOD the folder to 777

Edited by DeadDingo
Link to comment
Share on other sites

This might be a silly question but does the version of PHP your host is using supprt GD Library (You will need to ask them)

 

If i go to my admin and click on server info there stands this:

 

PHP Version 5.0.5

 

gd

GD Support enabled

GD Version bundled (2.0.28 compatible)

FreeType Support enabled

FreeType Linkage with TTF library

FreeType Version 1.3

GIF Read Support enabled

GIF Create Support enabled

JPG Support enabled

PNG Support enabled

WBMP Support enabled

XBM Support enabled

 

Is it good? or should i check elsewhere?

 

Friendly greetings

Edited by bougie
Link to comment
Share on other sites

Hello all, fantastic contribution. I'd really like to utilise it all due to the amazing capabilities of this thing, but am having some trouble getting it to work. I've read the thread but can't seem to track down a reason for the things I'm experiencing, so here's what's up and if you can help.... :)

 

Totally sure it installed correctly both times I did it. I'm not utilising the png workaround due to not having any png's.

 

1/. Images are not resampling resulting in bad quality images.

2/. Borders/Frames don't work at all

3/. Imagemagic is not showing in the url

4/. Sizing of the images seems to be working, but whether the images show up at all or not seems to be dependent on the size values in the admin settings.

5/. catalog/thumbnails did not generate automatically but have now created it along with thumbnails/images and set it to 777

6/. In the admin settings when clicking on the setting to select watermarks, either images or text, nothing is shown in the drop down box, but the files are present in catalog/includes/imagemagic/watermarks and catalog/includes/imagemagic/fonts so the watermarks aren't working either.

 

I'm running php version 4.4.2, GD support is enabled version 2.0.28

 

And that's all I can think of...

 

The site is at www.dragonprofiles.co.uk/profiles if someone could have a look and a reason for why the images look terrible pops into their head, I'll give them a big kiss.

Link to comment
Share on other sites

Okay, I just switched the master switch off and nothing changed, so image magic isn't working at all anyway.

 

Thinking it might be a GD problem, but server info say it's enabled and easily capable of handling it all?

 

I dl'd the most recent version and it did install correctly apart from not creating the catalog/thumbnails folder?

 

What's all that about then?

 

lol

Link to comment
Share on other sites

In the instructions there is a fix for png files

 

Yes there is and that makes the problem.

 

If I put the fix script to popup_image.php it doesnt open the whole picture with IE. I mean if I have a pic 400*400px it will only show a little part of it. BUT if I dont put the script to the popup_image.php it pop-up the picture as it should except that picture has that blue background becouse (IE bug).

 

So now I dont use that script in the popup_image.php becouse I think its better to have blue background than popup-image size of tha stamp.

 

But has anyone else this problem or is this only my problem this popup image size?

Link to comment
Share on other sites

Reference my previous posts.

 

The hosters have just got back to me and ask whether there is a specific path to the GD library set as it could be incorrect.

 

Anyone know where this would be found?

 

Cheers.

Link to comment
Share on other sites

also in my admin my LOGO is not showing....... I was told my one member here to take out the size of the logo but that hasn't worked for me....only the invoice and packing slip have worked for that. When I right click the LOGO on the top left in the admin I get this tag....

 

http://tsurishopjapan.com/admin/imagemagic...;h=72&page=

 

I don't get it?

 

Nigelman :thumbsup:

Link to comment
Share on other sites

You can set it using your FTP client.

PHP 5 could be the problem, I'm not sure. But why you have thumbnails/images/images/ folder? You should have only thumbnails/images/

 

Hi,

 

I know that i can set it via FTP but if i want to do that he says this problem:

 

Requested action not taken (e.g., file or directory not found, no access).

 

How can i get acces to this?

 

And it's something strange with the folder 'images', i my configuration i've set it like tis:

 

Thumbnail Cache directory /thumbnails

 

And i've created a folder in my "/catalog" with the name "/thumbnails", this is how is should work, yes?

But when i now put the imagemagic "on" and go to my index page of the shop he automaticly puts thumbnails in the image folder but the strange part is that he automaticly makes this folder "/thumbnails/images" and this folder "/thumbnails/images/images" and in both folders are the same images. What am i doing wrong?

 

Friendly greetings

Link to comment
Share on other sites

And it's something strange with the folder 'images', i my configuration i've set it like tis:

 

Thumbnail Cache directory /thumbnails

 

And i've created a folder in my "/catalog" with the name "/thumbnails", this is how is should work, yes?

But when i now put the imagemagic "on" and go to my index page of the shop he automaticly puts thumbnails in the image folder but the strange part is that he automaticly makes this folder "/thumbnails/images" and this folder "/thumbnails/images/images" and in both folders are the same images. What am i doing wrong?

 

Friendly greetings

 

Forget this last problem, it's solved.

Now the only problem is that he stores the thumbnails in this folder "/thumbnails/images" but i still can't see them in the shop. What can be the problem?

Edited by bougie
Link to comment
Share on other sites

I have a problem , at my webshop at www.ATUALOJA.COM the imagemagic has no problems , everything is correct but when i change to SSL HTTPS ( https://www.atualoja.com ) the images dos not appear .... (broken link)

Do u know any solutions for that ?

Thanks in advance

I tried to access this: https://atualoja.com/imagemagic.php?img=ima...;h=78&page=

and it says Warning: glob(): SAFE MODE Restriction in effect.

If you have in your cgi-bin a php.ini file, try to add this line: safe_mode=off

I'm not sure if it will work, but if it doesn't, remove that line from php.ini.

Link to comment
Share on other sites

BTW, I noticed something on your website...

I don't think those 2 links "Login de Clientes" and "Sair da TUA conta" in your header look professional.

Go to includes/header.php, find

<tr><td><img src="images/m07.gif" align="absmiddle" height="8" width="8">   <a style="font-size: 10px;" href="login.php" class="ml">Login de Clientes</a><br></td></tr>
				<tr><td><img src="images/m07.gif" align="absmiddle" height="8" width="8">   <a style="font-size: 10px;" href="logoff.php" class="ml">Sair da TUA conta</a><br><br></td></tr>

and replace with

<tr><td><img src=images/m07.gif width=8 height=8 align=absmiddle>   <?php if (tep_session_is_registered('customer_id')) { ?><a style="font-size:10px" href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class=ml><?php echo HEADER_TITLE_LOGOFF; ?></a><br><?php } else  echo '<a style="font-size:10px" href="' . tep_href_link(FILENAME_LOGIN, tep_get_all_get_params(), 'SSL') . '" class=ml>' . HEADER_TITLE_LOGIN . '</a>'; ?><br><br></td></tr>

The visitors will see "Login de Clientes" if they are not logged and "Sair da TUA conta" will be displayed only when are looged in.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...