Jump to content
Sign in to follow this  
tomjmul

Support thread for the Image Magic contribution

Recommended Posts

okay fixed it everything works. ;) no bigger images than normal, but imagemagic.php is not showing up in the location of the picture

Share this post


Link to post
Share on other sites
PHP version:4.3.10

 

GD enabled

 

I'm sure what problem suddenly all the pic gone

I have "error No GD library" now

 

What happened?

 

I would recomment restoring your backups and install again. This looks like a "1 tweak too far" type problem :)

 

does anybody have the imagmagic.sql file? I don't seem to have it in the rar archive

 

You started a maverick thread in the forum earlier today with this problem, to which i posted the solution


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

Andreas,

Ultrapics uses 3 different types of thumbnail - ULT_THUMB_IMAGE_*, MEDIUM_IMAGE_* and LARGE_IMAGE_* (* = WIDTH or HEIGHT)

 

What I wrote yesterday is valid, but now I can give you some concrete code

 

in imagemagic.php replace:

 

// 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_";
}

 

With:

// 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;
elseif ($_GET['w'] == ULT_THUMB_IMAGE_WIDTH || $_GET['h'] == ULT_THUMB_IMAGE_HEIGHT) $thumbnail_size=6;
elseif ($_GET['w'] == MEDIUM_IMAGE_WIDTH || $_GET['h'] == MEDIUM_IMAGE_HEIGHT) $thumbnail_size=7;
elseif ($_GET['w'] == LARGE_IMAGE_WIDTH || $_GET['h'] == LARGE_IMAGE_HEIGHT) $thumbnail_size=8;
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_";
}

 

After:

   case 5:
  if (FRAME_POPUP=="Yes") $frame=true;
  if (BEVEL_POPUP=="Yes") $bevel=true;
  if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;
  if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;
  $quality=(int)POPUP_JPEG_QUALITY;
  break;

 

Add:

 

  //change the settings for ULT_THUMB_IMAGE
 case 6:
  $frame=true;
  $bevel=true;
  $image_watermark=true;
  $text_watermark=true;
  $quality=100;
  break; 

 //change the settings for MEDIUM_IMAGE
  case 7:
  $frame=true;
  $bevel=true;
  $image_watermark=true;
  $text_watermark=true;
  $quality=100;
  break; 

 //change the settings for LARGE_IMAGE
  case 8:
  $frame=true;
  $bevel=true;
  $image_watermark=true;
  $text_watermark=true;
  $quality=100;
  break;

 

(Damn it!! I hate the way indents are removed from code on this fourm, what the hell is the point of code tags if if won't keep indents....bloody stupid)

 

Anyway, let us all know how it works out


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

Hi Tom,

 

you're really fast, man !

I changed the code in the imagemagic.php, as you said, but nothing happened to the other 5 images.

No error message, site is of course working, but also no change / inclusion of the other 5 images.

 

I also allowed myself to test another code snippet like this:

//change the settings for ULT_THUMB_IMAGE

case 6:

if (FRAME_POPUP=="Yes") $frame=true;

if (BEVEL_POPUP=="Yes") $bevel=true;

if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;

if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;

$quality=(int)POPUP_JPEG_QUALITY;

break;

 

//change the settings for MEDIUM_IMAGE

case 7:

if (FRAME_POPUP=="Yes") $frame=true;

if (BEVEL_POPUP=="Yes") $bevel=true;

if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;

if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;

$quality=(int)POPUP_JPEG_QUALITY;

break;

 

//change the settings for LARGE_IMAGE

case 8:

if (FRAME_POPUP=="Yes") $frame=true;

if (BEVEL_POPUP=="Yes") $bevel=true;

if (USE_WATERMARK_IMAGE_POPUP =="Yes") $image_watermark=true;

if (USE_WATERMARK_TEXT_POPUP =="Yes") $text_watermark=true;

$quality=(int)POPUP_JPEG_QUALITY;

break;

 

Sorry for posting without the code-tags. I'm running linux on all my boxes and with firefox, all code-areas are blanked white out. I still can copy and paste the content to a notepad, but its not visible in firefox. Also strange.

 

But back to topic, my altered code snippet did not changed something on the situation, all the other 5 images are still not thumbnailed.

 

Regards,

Andreas

 

PS: Sorry for calling you Tim all the time, just figured out that your name is Tom. Sorry

Edited by Andreas2003

Share this post


Link to post
Share on other sites
PS: Sorry for calling you Tim all the time, just figured out that your name is Tom. Sorry

 

haha, I was wondering about that. Anyway WGAS what I am called, as long as it's nothing too rude :D

 

Have you given these images a maximum width or height in your admin panel?

 

P.S Let's keep it simple and see if we can get the code working for you first before you try modding it. (What you posted wouldn't work) ;)


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
Have you given these images a maximum width or height in your admin panel?

 

That was the missing point, now it works for all images !!

And it works even with my 'modified' code :-)

Thank you very much!!

 

So, is the code now ready to go, or is there a little tweaking required additionally ?

 

Another question I have in mind is, if there is the possibility to re-create the cache of thumbnails at once ?

Webspace is not the point but performance is. So it would be good to re-create the cache completely.

 

Next question I have is, if I can simply rename my images folder ?

Of course I have to change the settings in the configure.php.

But do I have to change something in your contrib ?

 

Thanks in advance,

kind regards

Andreas

Share this post


Link to post
Share on other sites
For anyone that installs this contrib there are three reasons (that I can see) why imagemagic.php would not show up in the image properties url.

 

1. Image magic is switched off (unlikely, unless you did so specifically)

2. Width or height in configuration -> images is set to a percentage value or not set at all for the partuclar sized thumbnail

3. The thumnail size set in admin is exactly the same width AND height as the source image (in which case, i/m will interpet it as a store, rather than a product image.

 

The solution for the last one is to set the thumbnail to be a different width or height than the actual width or height of the image itself - even if it is only 1 pixel smaller.

 

This is assuming that i/m is installed correctly. Double check that the instructions in the readme have been followed exactly.

 

Hi I've just installed this contrib and my thumbnail images look just the same ? , the url doesn't have imagemagic in the path ?

 

I had to create a dir called "thumbnails" and chmod to 777 ..... correct ?

 

 

 

any help ?

Share this post


Link to post
Share on other sites
That was the missing point, now it works for all images !!

And it works even with my 'modified' code :-)

Thank you very much!!

 

Glad it worked out for you. Yes, the modified code will technically work fine, but your extra images will take on the properties of your pop-up images. You won't be able to seperate the two. Try switching a particular feature on or off for your pop-up images and will will see aexactly what I mean

 

So, is the code now ready to go, or is there a little tweaking required additionally ?

 

I don't really get you.

 

Next question I have is, if I can simply rename my images folder ?

Of course I have to change the settings in the configure.php.

But do I have to change something in your contrib ?

 

It's not i/m you have to worry about, but your entire catalog of products will need to be updated with the new location. I/M will work with any images forlder with no change to any settings as long as the image path is correctly specified in the database.

 

 

is the possibility to re-create the cache of thumbnails at once ?

Webspace is not the point but performance is. So it would be good to re-create the cache completely.

 

No, not really. It would be impossible to know which images are meant as which type thumbnails in advance. The only time this decision can be made is when osc asks for a particular image in a particular size.

 

 

Hi I've just installed this contrib and my thumbnail images look just the same ? , the url doesn't have imagemagic in the path ?

 

Andy, post or pm me your store's url

Did you update your database ok? Is there a new image magic configuration menu in your admin panel?

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
Andy, post or pm me your store's url

Did you update your database ok? Is there a new image magic configuration menu in your admin panel?

 

 

Yes , the database install seemed to go well using PHPmyadmin , no errors reported.

 

I can see the image magic config in admin , the only odd thing in admin is the standard OSc logo does not show , and interestingly the URL for that contains the image magic path

 

http://www.hdpower.co.uk/admin/imagemagic....=204&h=50&page=

 

Thumbnails still show original path eg -

 

http://www.hdpower.co.uk/images/RPC48973.jpg

 

 

http://www.hdpower.co.uk

 

Thanks a lot for a quick reply

Share this post


Link to post
Share on other sites
I can see the image magic config in admin , the only odd thing in admin is the standard OSc logo does not show , and interestingly the URL for that contains the image magic path

 

THAT is a big clue....

 

It looks like you modified the tep_image finction in your catalog/admin/includes/html_output.php rather catalog/includes/html_output.php

 

IE you may have changed the admin side rather than store side.


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
THAT is a big clue....

 

It looks like you modified the tep_image finction in your catalog/admin/includes/html_output.php rather catalog/includes/html_output.php

 

IE you may have changed the admin side rather than store side.

 

 

 

:o :o

 

I'll see if thats it .... :blush:

 

 

Thanks a lot

Share this post


Link to post
Share on other sites
..., but your extra images will take on the properties of your pop-up images. You won't be able to seperate the two.

I realized it. How is it possible to seperate them from the large-settings ? Just with taking your posted code ?

 

I don't really get you.

This question was/is combined with the a.m. one. So it this your final version, or do you think, that additional tweaking is somewhere necessary?

Or is this the final version by taking your posted code ?

 

I/M will work with any images forlder with no change to any settings as long as the image path is correctly specified in the database.

I had only the question, that if I want to move/rename my image folder, if I have to change setting in your contrib as well, or is it done by only changing the image folder setting in the configure.php. But to take the answer of your posting, I think its done by only changing the configure.php.

 

Kind regards

Andreas

Share this post


Link to post
Share on other sites
more pop_up ?

image_magic_v1_1+3 pictures in item description don't work (

 

 

Yeah, I am currently changing servers at the moment

 

This question was/is combined with the a.m. one. So it this your final version, or do you think, that additional tweaking is somewhere necessary?

Or is this the final version by taking your posted code ?

 

To be honest, I still don't know what you mean. This is a tweak to get your extra images working only. If it has (as you say it has), then voila...case closed.

 

How is it possible to seperate them from the large-settings ? Just with taking your posted code ?

 

By using the code I first told you to use, and then manually altering the true/false values in each one depending on which features you require with each type of additional image, again as I first said.

 

You could also add the config vars to your admin panel to individually switch on or off features for these thumbs, but this is way outside of the scope of how far I will be going.

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

The code is not currently showing up in my link settings imagemagic.php isnt showing up its product_info and i beleive i installed it correctly.

Share this post


Link to post
Share on other sites

Hi All,

 

I am sorry about this, I am still unable to get the pictures after installing the Image Magic. If I switch it off from Admin/Image Magic I can see the images but ofcourse not imagemagic in URL. when I switch it on, the images do nto show up??? I am really really puzzled. I bet I am doing silly mistake!!! Here is the URL:-

 

http://www.trendysmykker.com/

 

I would really really appreciate ANY help whatsoever!

 

Thanks

cifp48

Share this post


Link to post
Share on other sites

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')');

}

if ($connection == 'NONSSL') {

$link = HTTP_SERVER . DIR_WS_ADMIN;

} elseif ($connection == 'SSL') {

if (ENABLE_SSL == 'true') {

$link = HTTPS_SERVER . DIR_WS_ADMIN;

} else {

$link = HTTP_SERVER . DIR_WS_ADMIN;

}

} else {

die('

 

Error!

 

Unable to determine connection method on a link!

 

Known methods: NONSSL SSL

 

Function used:

 

tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')');

}

if ($parameters == '') {

$link = $link . $page . '?' . SID;

} else {

$link = $link . $page . '?' . $parameters . '&' . SID;

}

 

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

 

return $link;

}

 

function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {

if ($connection == 'NONSSL') {

$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;

} elseif ($connection == 'SSL') {

if (ENABLE_SSL_CATALOG == 'true') {

$link = HTTPS_CATALOG_SERVER . DIR_WS_CATALOG;

} else {

$link = HTTP_CATALOG_SERVER . DIR_WS_CATALOG;

}

} else {

die('

 

Error!

 

Unable to determine connection method on a link!

 

Known methods: NONSSL SSL

 

Function used:

 

tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')');

}

if ($parameters == '') {

$link .= $page;

} else {

$link .= $page . '?' . $parameters;

}

 

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

 

return $link;

}

 

////

// The HTML image wrapper function

function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

$image = '' . $alt . '<$n; $i++) {

$field .= ' '"', '\'' => ''', '<' => '<', '>' => '>')) . '';

}

$field .= '';

 

if ($required == true) $field .= TEXT_FIELD_REQUIRED;

 

return $field;

}

?>

 

 

The above is showing up in my admin/includes/functions/html_output.php any ideas?

Share this post


Link to post
Share on other sites
Hi All,

 

I am sorry about this, I am still unable to get the pictures after installing the Image Magic. If I switch it off from Admin/Image Magic I can see the images but ofcourse not imagemagic in URL. when I switch it on, the images do nto show up??? I am really really puzzled. I bet I am doing silly mistake!!! Here is the URL:-

 

http://www.trendysmykker.com/

 

I would really really appreciate ANY help whatsoever!

 

Thanks

cifp48

 

 

Hi

I had a look at your site and it looks like a php error has crept in somewhere during install.

I think you should restore your backups and try the install again.

Tom


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

everythings fixed did as the readme told me and this is what i get

 

http://direct-retail.net/Online-Shopping/

 

any ideas why imagemagic isnt showing up? i edited htmloutput catalog/includes not the admin/includes and general.php and all the imagemagic.php and imagemagicfunctions.php are where they are supposed to be along with the sql injection and imagemagic tab is currently showing up in my oscommerce. Also under the images tab all widths are set to 100 and height set to 0 hopefully that helps

Edited by embalmer

Share this post


Link to post
Share on other sites

Hey Tom,

 

I finally found some time to give your great contrib a run and must say that the experience is really great! No "what the .... is this all about", the instructions are very clear.

Also, the generated images are very good, and it's really great that the proportions are kept (when one of the dimensions is set to 0 of course).

 

Some things I noticed:

  • the readme.html is mentioning the wrong .sql file, it should be referencing autothumb.sql, not imagemagic.sql
  • I had to change the Thumbnail Cache dir to \thumbnails (backslash as opposed to forward slash - I'm using a Windows machine to develop)

Now, as you may remember from the other thread, I'm one of those guys who's trying to get PNG transparency to work in IE. So I've set your "Apply Internet Explorer PNG Transparency work-around?" to True.

However, when this is activated I'm experiencing very inconsistent image display behaviour in IE: the PNGs are not showing up all the time. Hitting F5 scrambles the displayed images. Here's a small example to clarify what I'm trying to say: let's say there's this page that displays 3 PNGs. First time the page loads: PNG1 and PNG3 are displayed, PNG2 is not. Hit F5: PNG2 and PNG3 are displayed; PNG1 not. Hit F5: none of the PNGs are displayed, and so on...

Any idea what may be causing this? I'm currently really considering to start using JPeG instead of PNG...

 

One other thing: I thought your contrib would also have the option to disable pop-ups. But I could not find this in the settings. I may be remembering this wrongly and if that's the case, just ignore this sentence. But if it's not, where can I disable them?

 

Many thanks for this great contrib! :thumbsup:

 

Cheers,

Valentino.

Share this post


Link to post
Share on other sites

Hi Valentino,

 

Glad you like it and thanks for the positive comments.

 

the readme.html is mentioning the wrong .sql file, it should be referencing autothumb.sql, not imagemagic.sql

 

Yeah, I know about that. It will be fixed in the next revision

 

Now, as you may remember from the other thread, I'm one of those guys who's trying to get PNG transparency to work in IE.

 

Yes I remember. It was you who inspired that part of i/m

 

However, when this is activated I'm experiencing very inconsistent image display behaviour in IE:

 

Any chance you might post or pm a link and I will have a look

 

I had to change the Thumbnail Cache dir to \thumbnails (backslash as opposed to forward slash - I'm using a Windows machine to develop

 

There is code in there to normalize all combinations of trailing or leading slashes and turn them into the correct format for the os being used. Are you sure you had to do this - I.E was it not working beforehand?

 

One other thing: I thought your contrib would also have the option to disable pop-ups.

 

Hmm, I think you are indeed mistaken. I can't off the top of my head think why anyone would want to disable the large sized pproduct image popup, but if you do, simply take the popup code out of product_info.php (original osc file)

 

Tom


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

First what to thank you for a great contributuion!

 

I am one of those who really dislikes pop-up images when I shop online and have changed the code for my store to show the large image right on the product info page. Why make your customer have yet another window to close when the large image, the description and price all fit well on the product info page?

I also only use 2 image sizes, small thumbnail and large image for simplicity.

 

I installed this yesterday and thought it was working correctly but not sure since my image properties seem to be larger if i/m is resampling my lg image. In admin-images...

 

Small Image Width blank

Small Image Height 120

 

Calculate Image Size true

Image Required false

 

Product Information Image Width blank

Product Information Image Height 360

 

Image magic shows up in url, properties are...Width 308px Height 360px Size 58.45 KB (59857 bytes)

 

Now after I blank out the Product Information Image Height so image magic lets the original image file load without i/m in the url and this is what I get for the properties of the image Width 309px Height 361px Size 35.22 KB (36062 bytes) I also see a slightly better image even though the file is much smaller.

 

These results are without using any filters, ie. frames, bevels, etc. Quality set to 100.

 

Doesn't seem to be right to me. Guess I would like to use my original file and still be able to add the frame filter to it unless there is something else you could suggest.

 

Thanks! Karen

Share this post


Link to post
Share on other sites

Hi Karen,

 

It is the very fact that you have your quality set to 100% that results in them having a larger filesize than the original.

 

If you look at the readme, it does state this can happen if images are saved at a quality less than 100% and then i/m is asked to produce them at a higher quality, the result can be a larger size with no improvement in quality. This is a JPEG thing.

 

The solution is to save the images in the first instance at 100% and ask i/m to produce them at a lesser amount. Even at 90%, you will notice a dramatic decrease in filesize.

 

I would never recpmmend serving large jpegs at 100% quality as it defeats the entire purpose of the file format.

 

Tom


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

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  

×