Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Additional Images Module


Parikesit

Recommended Posts

First I have to thank the author of this amazing contrib - it's really great.

 

I installed the contrib today and (unfortunately and probably by my mistake) I'm having difficulties. I'll try to explain what's the problem and I hope someone will be able to help me.

 

1/ I have the same problem as David427. I mean that the main picture for each product isn't shown, it's shown just as text with no image and after clicking the text and launching the popup the image's shown. In the admin section, the adress of the picture is shown like this: /var/www/web5/e78.cz/tmp/phpgYzz9r but when browsing the catalog as a normal visitor, the picture is not shown (of course because it doesn't exist) but the adress is correct (I mean: http://eshop.e78.cz/images/products/Vapor betony.jpg)

 

Now I found out that this happens only when I use the "generate now" function, but when I add the file manually, everything's fine. The other two images are always OK (even when I use "generate now" but the main image is never created and the adress /var/www/web5/e78.cz/tmp/phpgYzz9r doesn't exist of course).

 

2/ When the contrib tries to create a directory, it always makes an error that it couldn't be created even though the images directory is chmod 777.

 

These two problems really bother me. I even checked the config files but found no mistake.

Link to comment
Share on other sites

Hello! I was extremely excited about your newest (2.0) addition, but am having a lot of trouble. From the newest replies I've been reading, there seem to be some similarities.

 

I think I'm having the same problem as the one Wizaard identified this afternoon. When uploading the main product image or additional images, the smallest size is not being generated correctly (although the large and medium work perfectly!). Since the large and mediums are working, I doubt it's a permissions issue, correct? After attempted uploads, the thumbnail path in the admin and catalog are attempting to get an image from the php tmp folders (image wasn't moved from tmp properly???). Again, the medium and large images are working perfectly, both in the admin and catalog.

 

Any ideas? Thanks in advance.

Link to comment
Share on other sites

Just gotta say I added this contribution to my site last night and it seems to have installed without any problems. Took me a while to modify the product_info file, but only because a template had already changed it. Very impressed, looks like it has worked out of the box and I thank you.

Link to comment
Share on other sites

Hi Surfalot,

 

Ok I rechecked the origional contib code and changed the line I altered from:-

 

I'm still getting errors with the categories code.

 

Parse error: syntax error, unexpected $end in /var/www/workplace-essentials.co.uk/httpdocs/admin/categories.php on line 1784

 

1784 is my last line of code with my

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

code

 

I've saved the file as a zip and uploaded it so you can see where the problem lies. categories.zip

 

Cheers

Link to comment
Share on other sites

First I have to thank the author of this amazing contrib - it's really great.

 

I installed the contrib today and (unfortunately and probably by my mistake) I'm having difficulties. I'll try to explain what's the problem and I hope someone will be able to help me.

 

1/ I have the same problem as David427. I mean that the main picture for each product isn't shown, it's shown just as text with no image and after clicking the text and launching the popup the image's shown. In the admin section, the adress of the picture is shown like this: /var/www/web5/e78.cz/tmp/phpgYzz9r but when browsing the catalog as a normal visitor, the picture is not shown (of course because it doesn't exist) but the adress is correct (I mean: http://eshop.e78.cz/images/products/Vapor betony.jpg)

 

Now I found out that this happens only when I use the "generate now" function, but when I add the file manually, everything's fine. The other two images are always OK (even when I use "generate now" but the main image is never created and the adress /var/www/web5/e78.cz/tmp/phpgYzz9r doesn't exist of course).

 

2/ When the contrib tries to create a directory, it always makes an error that it couldn't be created even though the images directory is chmod 777.

 

These two problems really bother me. I even checked the config files but found no mistake.

if the code can't create the directories, it's a permissions problem unless your host is restricting the use of the php make directory command. Talk to your host and make sure you have the images directory owned by the account your web pages are running under and that the permissions are 777. that is for both /images/ and /products/ under that (assuming you are using the default configuration).

 

Also, spaces in image and directory names are illegal for web addresses.

Link to comment
Share on other sites

Hello! I was extremely excited about your newest (2.0) addition, but am having a lot of trouble. From the newest replies I've been reading, there seem to be some similarities.

 

I think I'm having the same problem as the one Wizaard identified this afternoon. When uploading the main product image or additional images, the smallest size is not being generated correctly (although the large and medium work perfectly!). Since the large and mediums are working, I doubt it's a permissions issue, correct? After attempted uploads, the thumbnail path in the admin and catalog are attempting to get an image from the php tmp folders (image wasn't moved from tmp properly???). Again, the medium and large images are working perfectly, both in the admin and catalog.

 

Any ideas? Thanks in advance.

what are the three image names the code added to your product?

Link to comment
Share on other sites

Hi Surfalot,

 

Ok I rechecked the origional contib code and changed the line I altered from:-

 

I'm still getting errors with the categories code.

 

Parse error: syntax error, unexpected $end in /var/www/workplace-essentials.co.uk/httpdocs/admin/categories.php on line 1784

 

1784 is my last line of code with my

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

code

 

I've saved the file as a zip and uploaded it so you can see where the problem lies. categories.zip

 

Cheers

Mmmm, that's a tough one since the error could be anywhere in the file. The best advice I have 4 u is to restore and try the merge again. with each change, save and load the file in your browser. If the error happens again, backout the last change and you will at least know where it is.

 

or start backing-out the additional image changes one by one, saving and check for each change until the error stops.

 

since it's a pre-execute error, just loading the file will tell you if your change was right or not.

Link to comment
Share on other sites

if the code can't create the directories, it's a permissions problem unless your host is restricting the use of the php make directory command. Talk to your host and make sure you have the images directory owned by the account your web pages are running under and that the permissions are 777. that is for both /images/ and /products/ under that (assuming you are using the default configuration).

 

Also, spaces in image and directory names are illegal for web addresses.

 

Thanks for the response. The code is having no problem at all creating directories under /images and /images/products. The directories are created seamlessly, as are the medium and large images within them. The small, thumbnail images are what's not being created. It's a mower site, so the images are mowers 060.jpg and mowers 060m.jpg (mowers 060s.jpg is missing). I realize there's spaces in there, but the medium/large work perfectly.

 

It's on a server with PHP5, globals off, and I'm not sure of the GD version (although it's working for the medium and large images, so doubt that's the problem).

 

Any ideas of what I should check? Thanks in advance!

Edited by electrovation
Link to comment
Share on other sites

Thanks for the response. The code is having no problem at all creating directories under /images and /images/products. The directories are created seamlessly, as are the medium and large images within them. The small, thumbnail images are what's not being created. It's a mower site, so the images are mowers 060.jpg and mowers 060m.jpg (mowers 060s.jpg is missing). I realize there's spaces in there, but the medium/large work perfectly.

 

It's on a server with PHP5, globals off, and I'm not sure of the GD version (although it's working for the medium and large images, so doubt that's the problem).

 

Any ideas of what I should check? Thanks in advance!

 

what are the three image names the code added to your product definition?

please do find your gd version.

please make sure the space is not causing problems.

Link to comment
Share on other sites

what are the three image names the code added to your product definition?

please do find your gd version.

please make sure the space is not causing problems.

 

Thanks again for the response.

The medium/large image names were correct for the products, but the path to my tmp folders (not a filename) was stored for the small images.

I have GD version 2.0.28.

The space isn't causing problems.

 

Thanks

Link to comment
Share on other sites

Thanks again for the response.

The medium/large image names were correct for the products, but the path to my tmp folders (not a filename) was stored for the small images.

I have GD version 2.0.28.

The space isn't causing problems.

 

Thanks

does it make any difference if it's a new product or an updated product save?

 

please enable debugging in admin/includes/classes/alterimage.php

 

this line#98 (change false to true):

 

	var $debug = false;		// only fill messages array if debugging

 

post the result messages from a new product save please.

Link to comment
Share on other sites

I have a strange but must be a stupid error.

 

I have v2.0.0 installed without problems. Admin > Configuration > Images:

 

Small Image Width 90

Small Image Height

Heading Image Width 50

Heading Image Height

Subcategory Image Width 100

Subcategory Image Height

Calculate Image Size true

Image Required false

Display Image Width 200

Display Image Height

Popup Image Width

Popup Image Height

 

Admin > Configuration > Additional Images:

 

Automatically create 3 image set true

Background color

Pre-fill upload dir w/ Category names true

Pre-fill starting with this sub-dir products

Use image size restrictions true

Product Info: Show Additional Images true

Product Info: Product Image Behavior popup

Product Info: Group parent with sub-images false

Product Info: Restrict parent image size true

Product Info: Table alignment center

Product Info: Table location below

Product Info: Number of columns 3

Product Info: Number of rows 2

Popup: Show Thumbnail Menu true

Thumb Menu: Show parent image true

Thumb Menu: Use image size restrictions true

Thumb Menu: Table alignment center

Thumb Menu: Table location below

Thumb Menu: Number of columns 3

Thumb Menu: Number of rows 2

 

Images are being uploaded and created without problems. as follows:

 

e.g

imagenams.jpg - 67 x 90 (Height)

imagenamm.jpg - 149 x 200 (Height)

imagenamm.jpg - 337 x 450 (Height) // image uploaded

 

This is already wrong since I wanted the 90 and the 200 to be the width of the image and not the height!

 

Second problem:

Within the website, images are actually being displayed as follows:

imagenams.jpg - 90 x 120 (Height)

imagenamm.jpg - 200 x 268

imagenamm.jpg - 337 x 450 (Height) // image uploaded

 

So in this case, it is using the 90 and 200 as the width of the image as I had configured.

 

Any ideas of what might be wrong?

 

Thanks

Link to comment
Share on other sites

I have a strange but must be a stupid error.

 

I have v2.0.0 installed without problems. Admin > Configuration > Images:

 

Small Image Width 90

Small Image Height

Heading Image Width 50

Heading Image Height

Subcategory Image Width 100

Subcategory Image Height

Calculate Image Size true

Image Required false

Display Image Width 200

Display Image Height

Popup Image Width

Popup Image Height

 

Admin > Configuration > Additional Images:

 

Automatically create 3 image set true

Background color

Pre-fill upload dir w/ Category names true

Pre-fill starting with this sub-dir products

Use image size restrictions true

Product Info: Show Additional Images true

Product Info: Product Image Behavior popup

Product Info: Group parent with sub-images false

Product Info: Restrict parent image size true

Product Info: Table alignment center

Product Info: Table location below

Product Info: Number of columns 3

Product Info: Number of rows 2

Popup: Show Thumbnail Menu true

Thumb Menu: Show parent image true

Thumb Menu: Use image size restrictions true

Thumb Menu: Table alignment center

Thumb Menu: Table location below

Thumb Menu: Number of columns 3

Thumb Menu: Number of rows 2

 

Images are being uploaded and created without problems. as follows:

 

e.g

imagenams.jpg - 67 x 90 (Height)

imagenamm.jpg - 149 x 200 (Height)

imagenamm.jpg - 337 x 450 (Height) // image uploaded

 

This is already wrong since I wanted the 90 and the 200 to be the width of the image and not the height!

 

Second problem:

Within the website, images are actually being displayed as follows:

imagenams.jpg - 90 x 120 (Height)

imagenamm.jpg - 200 x 268

imagenamm.jpg - 337 x 450 (Height) // image uploaded

 

So in this case, it is using the 90 and 200 as the width of the image as I had configured.

 

Any ideas of what might be wrong?

 

Thanks

the sizing is by design. if you only specify one dimension, the images will be proportionally sized as if you specified that dimension for both width and height. If you don't want that to occur, you must specify a maximum height also. the problem arises, and you may disagree, that if you have a kitchen mixing spoon whos image is 120 wide and 20 tall and you have a mixing spoon pictured 20 wide and 120 tall, you will end up with 2 very differently sized images if the code didn't work as I just described.

 

All resizing is done proportionally regardless of how you have you maximums set since the whole point of this contribution is to produce quality images for displaying.

 

As far as the displaying goes, if you are working with very differently dimensioned images you should be setting "Use image size restrictions" false so as to not restrict the image size when displaying (since you are using the feature to generate accurately sized images anyway, and proportional resizing will always mean your end result image will be different from the maximums you set). That setting is in the additional images configuration section.

Link to comment
Share on other sites

I fixed this problem in an ugly way by changing SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT to '', '90' in all the pages for thumbnail display and changed this parameter to 'Product Info: Restrict parent image size' in Additional Images to False and this solved the medium size image display.

 

Now all images are being displayed in the correct size as altered by your code.

 

Note, the problem was not your altercode but the way osc was displaying the resultant image.

 

The strange thing is that I have an exact copy offline and it works fine!!!!

 

Thanks

Link to comment
Share on other sites

I used the "Unprocessed Product Images" in the additional images utility to process products I already had in the system. For each of the 110 products, these types of errors were returned for all the products. Medium and large images are created correctly, just not the small thumbnails. Automatic thumbnail/medium image creation is enabled. I have small image widths set at 100px in the images configuration (no height), although "Use image size restrictions" in the additional image config is set to false.:

Error msg: starting create_srcImageResource() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 216
msg: starting imageOutput() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 373
msg: starting ApplyBackground() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 415
msg: starting AlphaChannelFlatten() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 445
msg: skipping AlphaChannelFlatten() because !$this->is_alpha file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 449

Error msg: starting create_srcImageResource() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 216
msg: starting create_outImageResource() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 244
msg: starting imageResizeNCopy() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 274
msg: starting imageOutput() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 373
msg: starting ApplyBackground() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 415
msg: starting AlphaChannelFlatten() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 445
msg: skipping AlphaChannelFlatten() because !$this->is_alpha file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 449

 

Error msg: starting create_srcImageResource() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 216
msg: starting create_outImageResource() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 244
msg: starting imageResizeNCopy() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 274
msg: starting imageOutput() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 373
msg: starting ApplyBackground() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 415
msg: starting AlphaChannelFlatten() file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 445
msg: AlphaChannelFlatten() set image to 255+1 colors with transparency for GIF output file: /hermes/web01/b1455/pow.electrovation/htdocs/admin/includes/classes/alterimage.php line: 510

Link to comment
Share on other sites

I also tried adding a new product with the automatic 3 sizes enabled. I received the message that the /product, /product/category, etc. folders were created correctly (which they were). It also stated that the medium image was created correctly, which it was.

 

However, the small thumb was not created and it didn't give me any errors about it. However, in the admin when you click on the product to edit it, it shows that the thumbnail is set to:

IMAGE DOES NOT EXIST

/home/users/web/b1455/pow.electrovation/htdocs/cgi-bin/tmp/phpow

Link to comment
Share on other sites

I also tried adding a new product with the automatic 3 sizes enabled. I received the message that the /product, /product/category, etc. folders were created correctly (which they were). It also stated that the medium image was created correctly, which it was.

 

However, the small thumb was not created and it didn't give me any errors about it. However, in the admin when you click on the product to edit it, it shows that the thumbnail is set to:

IMAGE DOES NOT EXIST

/home/users/web/b1455/pow.electrovation/htdocs/cgi-bin/tmp/phpow

php vers?

php globals (on/off)?

MySQL vers?

php GD vers?

windowz or linux?

web server? and vers?

Link to comment
Share on other sites

php vers?

php globals (on/off)?

MySQL vers?

php GD vers?

windowz or linux?

web server? and vers?

 

I answered all those questions in previous posts. You had asked me to turn on debug and let you know what happened.

Link to comment
Share on other sites

I answered all those questions in previous posts. You had asked me to turn on debug and let you know what happened.

right, brain fart. in your width max setting in the admin, you say you have "100px" or did you really mean "100"

Link to comment
Share on other sites

Well, I finally got it all to work. It was a combination of a few bugs.

 

Question: I noticed that when I delete a category/product, the 3 images remain in the directories. Are you ever planning on developing an auto-delete images upon product deletion in future releases???

Link to comment
Share on other sites

Well, I finally got it all to work. It was a combination of a few bugs.

 

Question: I noticed that when I delete a category/product, the 3 images remain in the directories. Are you ever planning on developing an auto-delete images upon product deletion in future releases???

are you ever going to share those bugs you found with us???

 

auto delete should be already included. what are you doing to delete the category/product?

 

like I said in the private message, this has worked flawlessly in over 10 installations for me.

Link to comment
Share on other sites

i installed=additional_images_1b

 

and now i get this line and im new to OSC

 

Fatal error: Call to undefined function: tep_array_merge() in /web/www.xsrpm.com.au/catalog/admin/categories.php on line 711

 

please help me

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