Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

the netpbm contribution


Guest

Recommended Posts

Posted

Could someone make it work?

I get only empty images :-(

 

Pierre.

  • 3 weeks later...
Posted

Me too and that is after netpbm was installed on my server. Must be something to do with the path I guess. I'm not sure if in the contribution this refers to php path or osC path.

Anyone know?

Posted

/* file image_resample.php Also change html_output as in ntpbm contribution */

 

$file = eregi_replace( '.([a-z]{3,4})$', "-{$width}x{$height}.1", $src ); // name of resampled image

$i = getimagesize( $src ); // need to know type and size

$oldwidth= $i[0];

$oldheight = $i[1];

// no support for gif in recent versions

if ( ($i[2] == 3) || ($i[2] ==2)) {

// if this file does not exist, then make it

if( !is_file( $file ) ) {

$dst = DIR_FS_CATALOG . '/' . $file; // name resampled (eg. pathimage-78x88.jpg )

$im = @imagecreatetruecolor ($width, $height); // create blank thumbnail

if ( $i[2] == 2) {

$oldim = @ImageCreateFromJPEG ($src); // Attempt to open large image

imagecopyresampled ($im, $oldim, 0, 0, 0, 0, $width, $height, $oldwidth, $oldheight); // mk thumb

imagejpeg ($im , $dst , 90); // save it compressed

}

elseif ( $i[2] == 3) {

$oldim = @ImageCreateFromPNG ($src); // Attempt to open large image

imagecopyresampled ($im, $oldim, 0, 0, 0, 0, $width, $height, $oldwidth, $oldheight); // mk thumb

imagepng ($im , $dst); // save it

}

}

$src = $file; // Use the resampled image

$width = $height = ""; // and it's own properties

}

Posted

The above post shows how I got it working but without netpbm. Simply replace the file 'image_resample.php' in the contribution with this one The other difference is of course the lack of gif support in recent versions.

Let me know if you try it.

hth

  • 1 month later...
Posted
The above post shows how I got it working but without netpbm. Simply replace the file 'image_resample.php' in the contribution with this one The other difference is of course the lack of gif support in recent versions.

Let me know if you try it.

hth

 

I seem to be having a problem getting the NetPBM contrib working even though NetPBM is installed corectly and work in other areas of our website:

 

http://www.oscommerce.com/forums/viewtopic.php?t=32864

 

So I thought I would give your fix a try. After replacing your code with the current image_resample.php code when I laod my stores page as soon as the first thumbnail is called (on the left side of the page) from then on the page is totally blank.

 

Any ideas?

  • 3 months later...
Posted

Hi radders!

 

Will this mod work like the Netpbm one? I'm a little confused. I would like to be able to attach one file (largest size) to my products, and then have it displayed as two thumbnail sizes, small and medium.

 

Is this what this mod does?

 

If not, could you please post a site showing what effect this has on images. I followed the instructions to update the code for both html_output.php and image_resample.php to a T and I don't see anything happening. Probably doing something wrong.

 

Maybe I should post the contents of image_sample.php and html_output.php?

 

Thanks for your help!

 

Steve

Posted

Hi Steve,

Yes that's how it works but the only file that needs changing is html_output.php

It is rather a long file so please just PM me your file.

  • 1 month later...
  • 1 month later...
Posted

It works great with NetRPM but the product description lost the click to enlarge option.

How do I get it back

 

Thanks

 

Deltablue

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...