Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support thread for the Image Magic contribution


tomjmul

Recommended Posts

This is the support thread for the 'Image Magic' contribution.

 

Image Magic is a powerful new contribution for OSCommerce designed to greatly improve the way your images are displayed. At the core of its functionality is the ability to produce smoothly rendered thumbnail (smaller) versions of your store's product images. In addition, it also contains a very comprehensive toolbox of 'on-the-fly' image processing functions to both improve your images and also, if you wish, protect them from theft and unauthorized use by your competitors, ebayers and the like.

 

If you are having difficulties installing or using this contribution, your first port of call should be the readme file contained within the package or available online in its most recent form:

here

 

Next, you should make sure you have the most up-to-date version of the contribution.

 

And lastly, read this thread to see if someone else has solved the issue.

 

If you are still having problems, then feel free to post here.

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

  • Replies 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Well done Tom.

 

Just going through it now and integrating it.

 

Issue with the readme.html in the install with html_output.php, the code is missing a ';' on the $image_size line. Should be this.

 

  if (strtolower(getcwd())."/" != strtolower(DIR_FS_CATALOG)) {
	$image_size = @getimagesize("../..".$src);
	$src=str_replace(DIR_WS_CATALOG_IMAGES,DIR_WS_IMAGES,$src);
 }

 

Thanks

Aaron

Aaron Dwyer

Link to comment
Share on other sites

Ok I'll be first cab off the rank and raise my hand to be dolt of the day.

 

Is anyone else unable to get their images to show.?

 

My product images <img src="blah"> tags are completely missing in the final html, hence no images are showing.

 

The other images (non-product) are all showing up ok.

 

I think this could be related to the shop / non shop image selection option (which is a good option to have).

 

I'm still investigating. Anyone have any ideas for me.

 

Thanks

Aaron

Aaron Dwyer

Link to comment
Share on other sites

After toggling options for the last half hour, I've worked out that you have to have set in the Images configuration for Image Required = true

 

This allows the images to be shown, and Image Magic is now doing it's thing.

 

I don't really want to have this set, since there are several instances of where I don't have an image, and I'd rather not see a failed image holder.

 

Any ideas?

 

Thanks

Aaron

Aaron Dwyer

Link to comment
Share on other sites

Hi Aaron,

 

Thanks for your help. I have fixed the readme.

 

Regards the images required setting, I have switched mine off and it is still working fine, this is going to take a little more tracking down.

 

Following the logic of the tep_image() finction, the only time the image required setting comes in to the equation, is when image magic cannot open the file asked for to check its dimensions (should be an indicator of a missing image file). In this case, it checks IMAGE_REQUIRED and if off, returns nothing (as it should). In your case, it would appear that it can't open any of your images and the paths are somehow wrong.

 

So here is where I'm confused. You say when you switch this on image magic works. Are you sure? Right click one of your images and see does the 'imagemagic.php' script show up in its url.

 

Tom

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

Aaron,

 

I have now taken out the admin side of this script as there is no need for it in my honest opinion and I can see it will cause a world of trouble (starting with that damn missing semi-colon :) ). The problem is the osC split admin/store way of doing things which I think everyone agrees is a complete nuisance and is to change in ms3.

 

The way I detect whether the script is running in admin and then alter the path was a hack and I never liked it. The other solution would be to go messing with configuration files and such, but I don't see the point.

 

For your version:

 

1. Restore admin/includes/html_output.php to original.

2. In catalog/includes/html_output.php

Change:

  // If running in Admin adjust the pathname
 if (strtolower(getcwd())."/" != strtolower(DIR_FS_CATALOG)) {
	$image_size = @getimagesize("../..".$src);
	$src=str_replace(DIR_WS_CATALOG_IMAGES,DIR_WS_IMAGES,$src);
 } 
 else {  
  $image_size = @getimagesize($src);
 }

 

To:

 $image_size = @getimagesize($src);

 

This should make everything work with the images required set false.

 

Let me know how you get on.

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

You were correct.

 

It wasn't using ImageMagic before at all.

 

The fix you just mentioned now works like a treat, and the ImageMagic is now actually being used.

 

I can now run with Image Required = false.

 

Thank you.

 

I'm one of the ones from On the Fly that could *never* get server caching to work on windows.

 

It didn't bother me before because I develop on windows and host with linux and it worked on linux.

 

Now I have a task to get it onto a host running windows and am still not able to server cache.

 

Does Image Magic store in an 'thumbnails' sub directory for each image directory or in 1 /images/thumbnails folder? I wasn't sure what the readme was referring to. I have several subdirectories since I've categorised my image directory.

 

My windows system is not writing the thumbnails to the drive at all. At least ImageMagic doesn't die badly when you have server cache turned on unlike On the Fly.

 

Thanks

Aaron

Aaron Dwyer

Link to comment
Share on other sites

Aaron,

The way caching works is as follows:

Lets say you have a categorized images directory /images/cat1 /images/cat2 images/cat3...etc

Now if you have your cache path set to /thumbnails, as the script starts getting used it will start shadowing your image directory under the thumbnails one. So the first time it is asked to produce a thumbnail from an image contained in /images/cat1 it will create a folder thumbnails/images/cat1 and cache the thumb there. This will eventually result in a complete shadow of all of the directories in your images folder within the cache one.

Regards windows, I will be installing a store on a windows machine within the next week or so. If I come across any major differences I will create a seperate windows version, otherwise I will tweak. I would have thought that it might have managed as it, but there you are.

What happens with caching turned on on windows?

Tom

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

hi,

thanks for the contribution. This looks great! I'm not very familiar with Image Magic so bear with me on my newbie question.

 

I'm working on a site that has product images that are not all the same width and height (although close). Will I have to make them all have at least one dimension the same (height or width) for my images to display with the correct proportions? Or is there a setting in this contribution that will assist with this?

 

Thanks!

 

 

Steve

Link to comment
Share on other sites

I'm working on a site that has product images that are not all the same width and height (although close). Will I have to make them all have at least one dimension the same (height or width) for my images to display with the correct proportions? Or is there a setting in this contribution that will assist with this?

 

Yes, you just need to set a maximum width OR height (but generally not both). When i/m is passed a width it will work out the height (and vice versa) itself so as to keep the image always in the correct proportions.

 

If one or more of your images are actually smaller than the dimensions of the thumbnail asked for, you have the 3 options. First, you can set i/m to scale it up. Second, you can have it just display at its native width and height - I.E Over-ride the thumbnail size. And lastly the thumbnail can be produced at the size required, with the source displayed at its size, centered on a white background

 

The basic idea of i/m is to ensure that your thumbnails are always uniform and in proportion

Edited by tomjmul

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

Hopefully someone else that runs Windows can confirm. But the server side caching isn't creating directories or of course the thumbnails. Time to break out the debug strings to find out what is going on.

 

Thanks

Aaron

Aaron Dwyer

Link to comment
Share on other sites

your work seems really so perfectionistic good features .. do you think taht you ll handle multiple image for a products liek mopics or other good contrib ?

best regards

 

Thanks Azer...I did try my best

 

Regards the extra images, it would be very easy to make this contribution work in conjunction rather than instead of these contribs. I may code this into a future version. I did include functionality for an extra sized product information image - The one on the product details page. I did this because I could swing it so that no other files would need modded as this image is only shown on one page, which I could detect.

 

 

Aaron, to save you a bit of poking, stick a few of those echos around the make_dirs() call in modify_tn_path()

 

Tell me, are you getting the cache creation error message in your images with caching switched on?

 

Anyone else tried caching on windows?

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

I get this error. The only other contrib I have installed is the SPPC 4.11

 

Parse error: parse error, unexpected '}' in /home2/sacredc/public_html/test/includes/functions/html_output.php on line 228

 

If I remove the } I then get an error in the header at line 87 <

Any ideas would be greatly appreciated.

Thanks

Link to comment
Share on other sites

Install file:

 

Step #4 - Add files

Copy the files contained in the zip archive to their respective directories on your server - Easy eh?

 

Hello,

 

I extracted the files and have empty folders at these locations:

 

admin/includes/imagemagic/fonts and watermarks. Is this correct?

2oldNslow

 

I am no expert, I am only trying to help.

Always, always back up.Use several browsers like IE,

Opera, Firefox and Netscape to view your work..

The free tools work great to do osCommerce changes,

PHP Designer 05/06, NoteTab Lite, SciTE, PSPad, XAMPP,

Filezilla, 1st Page, osCommerce is #1!

Link to comment
Share on other sites

Parse error: parse error, unexpected '}' in /home2/sacredc/public_html/test/includes/functions/html_output.php on line 228

 

You might have installed it wrong, restore your backups and try again.

 

I extracted the files and have empty folders at these locations:

 

I have removed the admin functionality. Download the latest version on the contribs section of oscommerce.

 

I have installed the new version of this comtribution, but the image magic in admin does not seem to work@ eg i have added the 3d frame and nothing happens also the images seem to be the same as before. pls help

 

To see if im is working properly, right click the image, select properties and check to see if imagemagic.php is in the url

OSC Image Magic

On-the-fly thumbnails, watermarks and image processing

Link to comment
Share on other sites

Lots of echo's and 1/2 hour later I have solved the mysterious Windows issues.

 

You must use the full path. DIR_FS_CATALOG. Adjusted to remove the extra slashes. I can't see why full path wouldn't work under unix as well. We'll soon see.

 

Tom maybe you can make this code better and work something into your contrib.

 

in file /catalog/imagemagic.php

in function modify_tn_path($file, $check_cache)

 

			//create the directory tree if not already there
		$create_path=dirname($tn_path. $file);
//added this line for windows
		$create_path = substr(DIR_FS_CATALOG,0,strlen(DIR_FS_CATALOG)-1) . $create_path;

 

and

 

//			return $tn_path. $file;
//comment the above line, added this line for windows
		return substr(DIR_FS_CATALOG,0,strlen(DIR_FS_CATALOG)-1) . $tn_path . $file;

 

Thanks

Aaron

Edited by aarondwyer

Aaron Dwyer

Link to comment
Share on other sites

You might have installed it wrong, restore your backups and try again.

I have removed the admin functionality. Download the latest version on the contribs section of oscommerce.

To see if im is working properly, right click the image, select properties and check to see if imagemagic.php is in the url

 

 

Hi,

Thanks for getting back.

 

Ok i have right clicked on the image properties and imagemagic.php is not in the url. my properties show

http://domani name/store/images/bodyring.JPG.

 

Any help would be great. I followed the install instructions to the t. Which was posted on 21st November 05.

 

Thanks

Link to comment
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.

Link to comment
Share on other sites

Tom,

 

I have installed, but not producing images. Image info does point imagemagic.php. I am running Windows server.

 

Tim

 

Hi Tim

 

You should read the posts above, they will probably answer your question. Check image setup that you don't have both width and heights set.

 

Also see my above posts regarding windows. Try to turn caching off first.

 

Aaron

Aaron Dwyer

Link to comment
Share on other sites

I think I installed this succesfully. But now all of my images show up really big. I adjusted the image sizes in the admin section but it did not work. Also, is there supposed to be a special admin menu for this? I don't see it in my config list. The "Product Information Image Width" option is there but I don't see another seperate menu. Also my images do not point to imagemagic.php. I would like to use this because all of the features but I can't get it to work.

Edited by compwhizmm90
Link to comment
Share on other sites

I think I installed this succesfully. But now all of my images show up really big. I adjusted the image sizes in the admin section but it did not work. Also, is there supposed to be a special admin menu for this? I don't see it in my config list. The "Product Information Image Width" option is there but I don't see another seperate menu. Also my images do not point to imagemagic.php. I would like to use this because all of the features but I can't get it to work.

 

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!!!

Link to comment
Share on other sites

Hi Tim

 

You should read the posts above, they will probably answer your question. Check image setup that you don't have both width and heights set.

 

Also see my above posts regarding windows. Try to turn caching off first.

 

Aaron

 

Server caching did it for me. I turned it off, all is well.

 

Awesome contribution. Super easy installation ( that they could all be so easy! ) I went from a 100 sec load time ( at 28.8) to under 40 seconds ( still tweaking!)

 

Thanks Tim

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...