Jump to content
Sign in to follow this  
tomjmul

Support thread for the Image Magic contribution

Recommended Posts

Absolute top contribution, layed out and coded in a very professional manner, installed and working in minutes... Well Done..:)

Share this post


Link to post
Share on other sites
Ok have it installed properly. The bevel works but the text watermark and the image watermark do not seem to work. It breaks the images no matter if they are .gif or .jpg.

Im on a Unix server. And the imagemagic.php is showing in picture link properties.

Any help would be greatly appreciated.

 

This looks like a GD version problem. Go to your tools, server info menu and see which GD version you have installed.

 

 

This server caching thing has got to be cracked. Some of these functions would take too long to execute for each and every visitor. It works flawlessly on two stores I have and I did try to code it as general as possible. Unfortunately file functions are probobly the least stable functions across different server set-ups.

 

Anyone who can't get server caching to work, please try to manually create the thumbnail cache directory specified in your admin panel and make sure that it is chmodded to 0777. Windows users make sure that it is writeable by the user php is running under and also have a look at aarondwyer's posts.

 

As I said, I will be installing on windows soon, and any tweaks I have to make, I will post too.

 

will32, where is your store and I will take a look

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
Ok I got the admin section to work. I had not copied all of the sql code. My images are also the correct sizes. But, my images still are not being being resized. There isn't anything in the thumbnail folder and the image urls do not contain imagemagic.php. Please help! Thanks!!!

 

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.

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
This looks like a GD version problem. Go to your tools, server info menu and see which GD version you have installed.

This server caching thing has got to be cracked. Some of these functions would take too long to execute for each and every visitor. It works flawlessly on two stores I have and I did try to code it as general as possible. Unfortunately file functions are probobly the least stable functions across different server set-ups.

 

Anyone who can't get server caching to work, please try to manually create the thumbnail cache directory specified in your admin panel and make sure that it is chmodded to 0777. Windows users make sure that it is writeable by the user php is running under and also have a look at aarondwyer's posts.

 

As I said, I will be installing on windows soon, and any tweaks I have to make, I will post too.

 

will32, where is your store and I will take a look

 

 

It shows I have GD Version bundled (2.0.28 compatible)

Thanks

Kaileen

Share this post


Link to post
Share on other sites

Great system, working like a charm.

 

Only thing was that it didnt make /thumpnails. Had to make that. After that. BOM. Up and running :D

 

Bj?rn

Share this post


Link to post
Share on other sites

Hi Tom,

 

thanks for your super-great contribution !!!

It works like charm on my site.

It is really great and impressive.

 

But I have some minor questions:

1.) I have the contribution installed called UltraPics, contrib no.1642, that places up to 6 additional images on the product info page.

 

It also changed some of the code in the product_info.php.

 

Can you please be so kind and give me some advise, what to change to get it working with your contrib ?

The strange thing is, that the first additional image, placed in the product info page, is processed correctly by your contrib, the other 5 images not.

 

2.) Watermarking:

I just copied my logo-file into the watermarking folder, it is an JPG, size 480x480.

 

In the product listing and the product info page, the watermarked image is appearing correctly, but when I click on the pop-up image, the image did not appear at all (just the alt-text is appearing).

Same happened, as I saved my logo-file as PNG.

 

When I change back to your provides PNGs, all is working.

 

Are there special requirements for the logo-file ?

 

Thanks again for your contrib, hopefully you can give me an advise, what to do with the Ultra Pics-Contrib.

 

Kind regards

Andreas

Share this post


Link to post
Share on other sites

Another question:

 

In the readme it is mentioned to backup both

- catalog/includes/functions/html_output.php

- catalog/admin/includes/functions/html_output.php

 

But later during installation, only the

- catalog/includes/functions/html_output.php

is edited.

 

Is this correct ?

Or do I have to place the same modifications to the

- catalog/admin/includes/functions/html_output.php

as well ?

 

Thanks in advance,

 

kind regards

Andreas

Share this post


Link to post
Share on other sites

i just tried installing this i did everything it said but its coming up with this

 

function tep_cfg_readonly($value){ $single[]= array('id' => $value, 'text' => $value); return tep_draw_pull_down_menu('configuration_value', $single, $value); } function tep_cfg_pull_down_installed_fonts($font_name) { if ($root=@opendir(DIR_FS_DOCUMENT_ROOT.'includes/imagemagic/fonts')){ while ($file=readdir($root)){ if($file=="." || $file==".." || is_dir($dir."/".$file)) continue; $files[]= array('id' => $file, 'text' => $file); } } return tep_draw_pull_down_menu('configuration_value', $files, $font_name); } function tep_cfg_pull_down_installed_watermarks($watermark_name) { if ($root=@opendir(DIR_FS_DOCUMENT_ROOT.'includes/imagemagic/watermarks')){ while ($file=readdir($root)){ if($file=="." || $file==".." || is_dir($dir."/".$file)) continue; $files[]= array('id' => $file, 'text' => $file); } } return tep_draw_pull_down_menu('configuration_value', $files, $watermark_name); } function tep_cfg_pull_down_watermark_alignment($watermark_alignment) { $align[]= array('id' => 'Tiled', 'text' => 'Tiled'); $align[]= array('id' => 'Top', 'text' => 'Top'); $align[]= array('id' => 'Top Left', 'text' => 'Top Left'); $align[]= array('id' => 'Top Right', 'text' => 'Top Right'); $align[]= array('id' => 'Center', 'text' => 'Center'); $align[]= array('id' => 'Bottom', 'text' => 'Bottom'); $align[]= array('id' => 'Bottom Left', 'text' => 'Bottom Left'); $align[]= array('id' => 'Bottom Right', 'text' => 'Bottom Right'); return tep_draw_pull_down_menu('configuration_value', $align, $watermark_alignment); }

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home2/embalmer/public_html/Online-Shopping/admin/includes/functions/general.php:1317) in /home2/embalmer/public_html/Online-Shopping/admin/includes/functions/sessions.php on line 67

 

any help?

Share this post


Link to post
Share on other sites
i just tried installing this i did everything it said but its coming up with this

any help?

 

Yes, delete all of the changes you made to includes/admin/functions/general.php AFTER the ?>

and do as the readme instructs - put the code BEFORE the final ?> :)

 

In the readme it is mentioned to backup both

- catalog/includes/functions/html_output.php

- catalog/admin/includes/functions/html_output.php

 

Sorry, my mistake - just ignore the admin one, there is no requirement (anymore) to change this file. Will take this out of the next revision

 

 

Can you please be so kind and give me some advise, what to change to get it working with your contrib ?

The strange thing is, that the first additional image, placed in the product info page, is processed correctly by your contrib, the other 5 images not.

 

i/m will detect the actual product image used on this page, but not the extra images produced by ultra pics. Unfortunately a solution to your problem would be a bit too indepth for me to produce a solution and post on this thread. If it is very important to you that these images are brought into the i/m fold, then pm me for a custom job, or have another php programmer do it for you.

 

Are there special requirements for the logo-file ?

 

None whatsoever. The only restrictions on the image watermarks is that they can't be used on GIF images (but gif images can be used as watermarks) Even then, nothing should happen other than the watermark not appearing on the source.

 

Ahha, the penny has just dropped!!

It can take quite a long time to produce a large watermark on a large image especially a 480x480 one. However, once it is produced, it will be cached and served instantly in the future. When you switch back to my images, the cached version is used, and that is why it appears these are working and your custom watermarks are not. Also, it will appear that your own watermarks are working in the other thumbnails, because obviously you have set them to a much smaller size, and thus the watermarked image is produced much quicker. The solution, hopefully, is just a little bit of patience.

 

 

It shows I have GD Version bundled (2.0.28 compatible)

 

That's good enough. The next thing to check is that the functions script is in the correct location and is being loaded by i/m

 

 

For everyone that stopped by to say thanks - You're very welcome and glad to hear it is working well for you. I wouldn't mind seeing how some other sites are using it, so please post or pm a few urls - thanks


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
okay fixed that error ^^^ but now image magic is not showing up in the configuration in oscommerce any ideas?

 

We seem to have cross posted. Glad to hear you fixed it on your own.

 

I am almost certain that the new problem you are having is also down to your concentration levels when doing the install. Have a look at the readme and follow EXACTLY.

 

Just one other thing while I am here and it is on my mind. Anyone having problems with server caching try switching off the auto clean cache thingy....or whatever i called it :)


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites
Ok have it installed properly. The bevel works but the text watermark and the image watermark do not seem to work. It breaks the images no matter if they are .gif or .jpg.

Im on a Unix server. And the imagemagic.php is showing in picture link properties.

Any help would be greatly appreciated.

 

Just occured to me when replying above - do the images break straight away or does it take a while?


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

I have installed the contribution and thought everything was fine except now some of my images aren't showing up and I recieve a division by 0 in line 139 when pasting the image code into the address bar.

 

Also I recieve undefined function in the admin when trying to set a wartermark. Any ideas?

 

http://www.firstclasswatches.co.uk/desgin

 

Scott


no outside links please

Share this post


Link to post
Share on other sites

I have fixed my above error by enabling file name encryption. It was only effecting a certain category.

 

I still have an undefined function.

 

I also mispelt the address it should be design not desgin

Edited by AoM_Scott

no outside links please

Share this post


Link to post
Share on other sites
I have fixed my above error by enabling file name encryption. It was only effecting a certain category.

 

I still have an undefined function.

 

I also mispelt the address it should be design not desgin

 

 

The undefined function is as a result of not installing the code to admin/includes/functions/general.php - Easily fixed...just restore and go again.

 

Regards the other error, I will check into it and get back to you.

 

Nice site btw - perfect for i/m :D


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

Hi Tom,

 

i/m will detect the actual product image used on this page, but not the extra images produced by ultra pics. Unfortunately a solution to your problem would be a bit too indepth for me to produce a solution and post on this thread.

 

is your contrib getting all "$product_info['products_image']" and converting them in the html_output.php ??

 

I understand that a complete solution is not possible in this thread, but this is also not that, what I'm asking for.

I only need some hints, that I know and understand, for what I have to look for.

 

I guess (and hope :) ), a.m. question to you, is answered with yes.

I had a look in the product_info.php, where the UltraPic-contrib has placed another image_function, and this is called for example :

$product_info['products_image_med'].

 

If I'm on the right way, I have to duplicate your function in the html_output.php and adapt it to products_image_med as well, correct ?

 

Thank you very much in advance,

kind regards

Andreas

 

Hi Tom,

 

It can take quite a long time to produce a large watermark on a large image especially a 480x480 one.

 

of course, you were right. I reduced the size of my watermark image to 240x240 and it is working perfectly :D .

 

Thanks !!

Share this post


Link to post
Share on other sites
I guess (and hope :) ), a.m. question to you, is answered with yes.

I had a look in the product_info.php, where the UltraPic-contrib has placed another image_function, and this is called for example :

$product_info['products_image_med'].

 

Andreas, this is how I would go about the thing:

 

1. Have a look in the configuration table of your store's database

2. Find the configuration key that corresponds to the width and height settings you give the extra images in your configuration -> images admin section

3. Find this section in imagemagic.php

 

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

 

Now, you notice that the $thumbnail_sizes variable can be either 1,2,3,4, or 5

 

well after the last elseif, put in another, but substitute the config vars for one you discovered in step 2 and give the $image_size a value of 6

 

Example:

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'] == MEDIUM_IMAGE_WIDTH || $_GET['h'] == MEDIUM_IMAGE_HEIGHT) $thumbnail_size=6;
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_";
}

 

(MEDIUM_IMAGE_WIDTH - Read:whatever?)

 

4. The easiest thing now to do would be to hard code into the script how you want to deal with this image_size

 

so for instance in the select block add this:

 

   case 6:
  $frame=true; 
  $bevel=false; 
  $image_watermark=true;
  $text_watermark=false;
  $quality=85;
  break;

 

Obviously I can't test this but at the same time, can't see why it wouldn't work

 

Good luck, and obviously, come back and report how it works out for you.

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Share this post


Link to post
Share on other sites

Hi Tom,

 

be sure :D , I will return and report, and also thanks for your quick answer.

 

But things are a little strange on the second look.

 

The only problem seems to be the product_info.php.

Through the UltraPic-Mod there are 6 additional images displayed at the end/bottom of the product page, underneath the description.

 

As I realized now, all images (UltraPic-Mod incl.) are processed through ImageMagic, because when I right-click on the image=>Properties,

the URL is displayed like www.URL.net/imagemagic.php?img=...encrypted_path...

So, each image is going through your imagemagic.php !

 

Also, when I enlarge one of the additional images, the pop-up image is processed also correctly with ImageMagic.

 

The first of the six is a little bit smaller displayed then the other 5. Seems to be the thumbnailing function is working here.

The first of them is also signed with the watermark.

So here, ImageMagic is definitly working correctly.

But this only the first of the six.

 

The other 5 images are displayed a little larger then the first one and does not have the watermark sign in it.

 

Perhaps its only a problem with the product_info.php.

Whats your guess ?

 

Regards

Andreas

Share this post


Link to post
Share on other sites

Installation seem to been alright!

 

However, I can't get the Watermark file or Text on the Product Info Pic, Pop-up Image

 

How to set it up? or what I have done wrong?

 

Thanks

Share this post


Link to post
Share on other sites
Installation seem to been alright!

 

However, I can't get the Watermark file or Text on the Product Info Pic, Pop-up Image

 

How to set it up? or what I have done wrong?

 

Thanks

 

Have you played around with all the options in the admin area ? First try the files for watermarking coming as default with the contribution.

Share this post


Link to post
Share on other sites

One more question:

 

The Thumbnails directory didn't auto create the Image Path

 

e.g.

Original file in

catlog/images/photos/female/DSC_0001.jpg

 

the Thumbnails directory I got thr result is

 

catalog/images/thumbnails/120_images_photos_female_DSC_0001.jpg

 

 

Suppose it should be in direvtory path not a filename right?

Share this post


Link to post
Share on other sites
One more question:

The Thumbnails directory didn't auto create the Image Path

 

Is the thumbnail dir created (its not done by the installation. Do it manually!) and chmoded 0777 ?

Then the contrib is keeping the complete structure you have in your image dir.

For example /catalog/thumbnail/cat1/image01.gif.thumb_xxxxx.png

Share this post


Link to post
Share on other sites

The create directory function is it only for Windows server?

 

Mine is Unix so that is not work right?

 

the Thumbnails directory already created and CHMOD is 777

 

already test the watermark and the Text watermark in Admin part still no show

 

cheers

Edited by vincenzo

Share this post


Link to post
Share on other sites
Perhaps its only a problem with the product_info.php.

Whats your guess ?

 

Regards

Andreas

 

Did you apply the fix - if so, then email me your new imagemagic.php and existing product_info.php

to: tm AT celtware D-O-T com

 

 

However, I can't get the Watermark file or Text on the Product Info Pic, Pop-up Image

 

It looks as though you have an older PHP version - try this:

 

In the tep_image() function Replace both occurances of $_SERVER['PHP_SELF'] with $PHP_SELF

(just $_SERVER['PHP_SELF'] I.E nothing before or after it on the same line)


OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

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?

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  

×