Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Image Resize v1.5


dreamscape

Recommended Posts

Implemented support for the admin upload class in newer OSC snapshots.

 

** Build on May 18th, 2003 snapshot. Needs tested on MS2 to verify support or not **

 

** Build off Image Resize v1.3a by Henri Schmidhuber **

 

http://www.oscommerce.com/community/contributions,350

 

What can it do:

- the uploaded image is copied into big image directory below your image directory

- then a small image according to the images settings (Small Image Width, Small Image Heigth) in the admin is made and copied into your image directory

- the big image can be resized too

- if something goes wrong (no gd-lib) it copies the original file to the image directory

- It corrects wrong filenames in uploaded images (empty spaces, specialchars...)  

- Three methods of resizing

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

  • Replies 71
  • Created
  • Last Reply

Top Posters In This Topic

** The regular version 1.5 DOES NOT work with MS2 **

 

I have released a v1.5 for MS2. I have not been able to test it on an MS2 system, but it should work.

 

http://www.oscommerce.com/community/contributions,350

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

http://www.directplastics.com/

 

Fatal error: Call to undefined function: imagegif() in /home/directpl/public_html/bigboss/includes/classes/upload.php on line 268

 

This was produced when attempting to add a GIF image to an existing product - JPEGs are OK.

 

Also, the large image is not displaying when I click the thumbnail - it just shows the thumbnail version again.

David @ 1cog.

Link to comment
Share on other sites

I guess BIG_IMAGE_SUBDIR is not being populated?

 

whoops... sorry about that David. I changed that variable name... it should be DIR_FS_CATALOG_IMAGES_BIG

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Fatal error: Call to undefined function: imagegif()in /home/directpl/public_html/bigboss/includes/classes/upload.php on line 268

 

This was produced when attempting to add a GIF image to an existing product - JPEGs are OK.

 

Certain versions of GD-Lib do not support GIFs. Nothing I can really do about that... just make sure in the config you have the right version selected that you are running (1.xx or 2.xx).

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

GD Support  enabled  

GD Version  bundled (2.0 compatible)  

FreeType Support  enabled  

FreeType Linkage  with freetype  

GIF Read Support  enabled  

JPG Support  enabled  

PNG Support  enabled  

WBMP Support  enabled

 

Looks like I've got GDLIB 2 and that's what is selected in Admin. Could the problem be something else? I've run GDLIB with other scripts without problem in the past on this server and GDLIB2 supports GIFs (???).

 

 

Big images problem now solved. :)

David @ 1cog.

Link to comment
Share on other sites

GD Support  enabled  

GD Version  bundled (2.0 compatible)  

FreeType Support  enabled  

FreeType Linkage  with freetype  

GIF Read Support  enabled  

JPG Support  enabled  

PNG Support  enabled  

WBMP Support  enabled

 

Looks like I've got GDLIB 2 and that's what is selected in Admin.  Could the problem be something else?  I've run GDLIB with other scripts without problem in the past on this server and GDLIB2 supports GIFs (???).

 

 

Big images problem now solved.   :)

 

according to that, only GIF read support is enabled. the others say "support enabled" and GIF says "Read Support enabled"... I am not sure, but would take that to mean the others are read/write; whereas GIF is read only.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I tried installing on MS2 when entering new products and previewing I get this error and no image( just empty box with the text but no pic

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 39

 

if (isset($_FILES[$this->file])) {

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 44

 

} elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 55

 

'tmp_name' => $GLOBALS[$this->file]);

Link to comment
Share on other sites

Looks like I've got GDLIB 2 and that's what is selected in Admin.  Could the problem be something else?  I've run GDLIB with other scripts without problem in the past on this server and GDLIB2 supports GIFs (???).

 

found this Daivd:

http://www.phpbuilder.com/board/printthrea...readid=10236496

 

Looks as though only GD lib v1.6 or earlier support GIF creation. Though newer ones support PNG, which is *supposed* to replace the GIF

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I tried installing on MS2 when entering new products and previewing I get this error and no image( just empty box with the text but no pic

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 39

 

if (isset($_FILES[$this->file])) {

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 44

 

} elseif (isset($GLOBALS['HTTP_POST_FILES'][$this->file])) {

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 55

 

'tmp_name' => $GLOBALS[$this->file]);

 

Those lines are found in the MS1 version, which will not work with MS2. Please install the MS2 version.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

Yes I used the MS2 version I wanted to compare it to big images which I have on MS1 shop

 

Those lines do not match up with the MS2 upload.php. they match up with the MS1 upload.php... some of those lines are not even found in the MS2 upload.php file.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

I just replaced the upload.php from the MS2 download and now I get

target_small: /home/mrsfield/public_html/catalog/images/3565.jpg

Resizing small image

Starting in_resize_image()

temp_pic:/tmp/phpms7lyk

image_new:/home/mrsfield/public_html/catalog/images/3565.jpg

width:500

 

Image has to be resized; checking for gd-lib

 

GD-Lib found start resizing

Image Format:2

 

Generated new SRC-Pic

GD-LIB 2 - Generated new Pic

 

target_big: /home/mrsfield/public_html/catalog/images/images_big/

Copying big image

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 44

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 49

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 60

Link to comment
Share on other sites

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 44

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 49

 

Warning: Illegal offset type in /home/mrsfield/public_html/catalog/admin/includes/classes/upload.php on line 60

 

those lines are part of the original MS2 upload.php script. They were not altered by the image resize mod. I have a feeling that if you revert to the original MS2 upload.php script (without the image resize) that you will still get those errors. Its an error that has to do with arrays, and something in the PHP configuration, I think.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

There is some legality about gif's that doesn't allow development of software to manipulate them. That is one of the reasons that png's are replacing gif's. It would be a good idea to get your favorite graphics progam out and convert the gif's to something else :)

[no external urls in signatures please, kthanks]

Link to comment
Share on other sites

I guess I will just delete this and use big images. Thanks for the help!

 

sorry about the bad luck man. From the info you posted, the image resize is working great (it resizes and copies the images), but then the upload script is failing in the function parse().. I did not touch that function in either the MS1 or MS2 versions... and no-one else is reporting a problem with Illegal offsets.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

There is some legality about gif's that doesn't allow development of software to manipulate them.  That is one of the reasons that png's are replacing gif's.  It would be a good idea to get your favorite graphics progam out and convert the gif's to something else :)

 

Actually that may start to change now... the patent on GIF compression has expired in the US (as of June 21th, 2003) and will expire in other countries next year (Canada expiring July 7, 2004; the UK, France, and Germany expiring June 18, 2004; and Japan expiring June 20, 2004).... whether GNU companies who could not use the GIF compression before will go back and add or re-add support for it remains to be seen. PNG is really the better format of the two, but which will prevail is hard to say.

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

Link to comment
Share on other sites

There is some legality about gif's that doesn't allow development of software to manipulate them. That is one of the reasons that png's are replacing gif's.

 

The patent for GIFs expired in the US last month and will expire around the rest of the world over the next year (?), so there is no longer an issue with using them because of patent fees.

 

PNG is unlikely to threaten GIFs until M$ provides full support for PNG in Windows IE (alpha transparency, etc.).

David @ 1cog.

Link to comment
Share on other sites

but then the upload script is failing in the function parse()..

Any ideas on how to fix this??

 

not really... are you on a test server or the same server as your live shop?? those lines refer to $GLOBALS... I am wondering if something in the php configuration is messing it up... only thing I can think of is registered globals... that error & that part of the upload script is out of my league really... maybe either contact the dev team or post in the general support about the MS2 upload class and those errors... may get more attention there

The only thing necessary for evil to flourish is for good men to do nothing

- Edmund Burke

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