Jump to content



Photo
* * * * * 1 votes

KissIT Image Thumnailer


  • Please log in to reply
277 replies to this topic

#261   dculley

dculley
  • Members
  • 444 posts
  • Real Name:Dean Culley
  • Gender:Male
  • Location:North Charleston, SC (USA)

Posted 11 May 2015 - 01:17

@raiwa

Rainer

 

My bad.  I went by "Version 12 BS update for OsC 2.3.1 Bootstrap+"  Thanking that because I was using BS and it said "update".  The other part that confused me was that I saw "upgrade", but no reference to BS. 

 

This time I went and took a chance on the "upgrade" installed it.  No errors.  Seems to be working. 

 

1 Question,  do I need to install standard thumbnailing  product page images?  If so what does it bring to the table?  I did not install it on the first go around. 

 

Thanks for your help, 

Dean



#262 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 11 May 2015 - 13:07

Hello Dean @dculley,

 

the colorbox/photogrid support in product_info.php will produce correct sized thumbs for the small images, regardless the amount of images, and will still pop up the full image size. So I would recommend to add it.

 

regards

Rainer



#263   phi148

phi148
  • Members
  • 146 posts
  • Real Name:Bill

Posted 24 May 2015 - 15:24

First I wanted to say thinks for the great contrib!

 

I just noticed the images on the products page do not have "alt" definitions.  Is it possible I did something wrong?  I'd like to make sure all my images have alt tags for SEO purposes.  Thanks!



#264 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 24 May 2015 - 16:07

Hello Bill @phi148,

 

Nothing to do with KissIt Thumbnailer.

If the main product image is used (no big product image added) there is the alt text.  If big images are added, there is no alt text for them.

See on the BS Gold demo:

http://www.template....?products_id=28

 

regards

Rainer



#265 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 24 May 2015 - 16:30

@phi148, you'll have always the main product image tagged with itemprop="image":

<img src="images/thumbs/my_product_image.jpg" alt="" class="img-responsive" itemprop="image" style="display:none;" />


#266   nafri

nafri
  • Members
  • 174 posts
  • Real Name:naf

Posted 03 June 2015 - 15:53

i installed the lastest version on a BS gold site.i  am getting black border around  thumbnales.There are Jpg images not png.

 

i have folowed what has been mentioned earlier  and check to make sure right edit has been added.

 

I have setup the images to be 450x 450 in admin.

 

Some images are small so a black border appears.if i cut down  the size of the thunbnails then    it doesn't .

 

But i need the images to be atleast 450.I didn't had this issue when i was using  the non BS  version of oscommerce.



#267 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 03 June 2015 - 16:12

Hello @nafri,

 

Did you change the background color in the tep_image function?? it should be like this for white background:

                                      'thumb_background_rgb' => array( 'red'   => 255,
                                                                       'green' => 255,
                                                                       'blue'  => 255 ) ) );

If this is correct, could you please pm your store URL to have a look.

 

regards

Rainer



#268   nafri

nafri
  • Members
  • 174 posts
  • Real Name:naf

Posted 03 June 2015 - 21:36

Hello @nafri,

 

Did you change the background color in the tep_image function?? it should be like this for white background:

                                      'thumb_background_rgb' => array( 'red'   => 255,
                                                                       'green' => 255,
                                                                       'blue'  => 255 ) ) );

If this is correct, could you please pm your store URL to have a look.

 

regards

Rainer

 

 

i did check this as mentioned   in one of your previous post..

 

i will pm you the store url  now..



#269 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 04 June 2015 - 19:11

Hello @nafri,

 

Oh yes, there is a bug for jpg images when smaller than the required thumb size.

 

Please apply this update to includes/modules/kiss_image_thumbnailer/classes/Image.php:

 

Find:

      if (  KISS_DISABLE_UPSIZE == 'true' && ($this->_width < $max_width || $this->_height < $max_height) ) {
        imagecopyresampled ( $new_image, $this->_image, (($max_width-$this->_width)/2), (($max_height-$this->_height)/2), 0, 0, $this->_width, $this->_height, $this->_width, $this->_height);
      } else {
        imagecopyresampled ( $new_image, $this->_image, 0, 0, 0, 0, $max_width, $max_height, $this->_width, $this->_height );
      }
      $this->_image = $new_image;
      if ( $this->_take_resize_dimensions_as_absolute ) {
        // the image has scaled badly we need to add a background
        $info = pathinfo($this->_filename);
        $image_name = $info['basename'];
        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) ) {
          $thumb_background = imagecreatetruecolor ( $this->_requested_thumbnail_width, $this->_requested_thumbnail_height );
          $background_color = imagecolorallocate ( $thumb_background, $this->_thumb_background_rgb['red'], $this->_thumb_background_rgb['green'], $this->_thumb_background_rgb['blue'] );
          imagefill ( $thumb_background, 0, 0, $background_color );
          $dst_x = 0;
          $dst_y = 0;
          $new_image_width = imagesx ( $new_image );
          $new_image_height = imagesy ( $new_image );
          if ( $this->_requested_thumbnail_width > $new_image_width ) {
            $dst_x = floor( ( $this->_requested_thumbnail_width - $new_image_width ) /2 );
          } elseif( $this->_requested_thumbnail_height > $new_image_height ) {
            $dst_y = floor( ( $this->_requested_thumbnail_height - $new_image_height ) /2 );
          }
          imagecopyresampled ( $thumb_background, $new_image, $dst_x, $dst_y, 0, 0, $new_image_width, $new_image_height, $new_image_width, $new_image_height );
          $this->_image = $thumb_background;
        }
      } // end need a background

Replace with:

      if (  KISS_DISABLE_UPSIZE == 'true' && ($this->_width < $max_width || $this->_height < $max_height) ) {
        $new_image = $this->_image;
      } else {
        imagecopyresampled ( $new_image, $this->_image, 0, 0, 0, 0, $max_width, $max_height, $this->_width, $this->_height );
      }
      $this->_image = $new_image;
      if ( $this->_take_resize_dimensions_as_absolute ) {
        // the image has scaled badly we need to add a background
        $info = pathinfo($this->_filename);
        $image_name = $info['basename'];
        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) ) {
          $thumb_background = imagecreatetruecolor ( $this->_requested_thumbnail_width, $this->_requested_thumbnail_height );
          $background_color = imagecolorallocate ( $thumb_background, $this->_thumb_background_rgb['red'], $this->_thumb_background_rgb['green'], $this->_thumb_background_rgb['blue'] );
          imagefill ( $thumb_background, 0, 0, $background_color );
          $dst_x = 0;
          $dst_y = 0;
          $new_image_width = imagesx ( $new_image );
          $new_image_height = imagesy ( $new_image );
          $dst_x = floor( ( $this->_requested_thumbnail_width - $new_image_width ) /2 );
          $dst_y = floor( ( $this->_requested_thumbnail_height - $new_image_height ) /2 );
          imagecopyresampled ( $thumb_background, $new_image, $dst_x, $dst_y, 0, 0, $new_image_width, $new_image_height, $new_image_width, $new_image_height );
          $this->_image = $thumb_background;
        }
      } // end need a background

Please confirm and I'll upload the update.

 

Thank you and kind regards

Rainer



#270   nafri

nafri
  • Members
  • 174 posts
  • Real Name:naf

Posted 04 June 2015 - 20:37

@Rainer

 

thanks for the fix ..  black border is  now gone.

 

 what i notice now is that if a image is 150x150 in width and the backend is set to 318x318 .It leaves the  image untouched. No white border is added to make the image size go up to 318x318.

 

Before i added your  above fix it was adding black background and increasing the size to 318x318.This also centered the image

 

is this normal behaviour.

 

Thanks for the contrib

 

regards

 

naf


Edited by nafri, 04 June 2015 - 20:38.


#271 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 05 June 2015 - 06:56

Hello @nafri,

 

OK, still an error for square images.

 

Please change this line within the changed snippet:

        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) ) {

To:

        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) || (KISS_DISABLE_UPSIZE == 'true' && ($this->_width < $max_width || $this->_height < $max_height)) ) {


#272   nafri

nafri
  • Members
  • 174 posts
  • Real Name:naf

Posted 05 June 2015 - 10:17

 

Hello @nafri,

 

OK, still an error for square images.

 

Please change this line within the changed snippet:

        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) ) {

To:

        if ( ($max_width < $this->_requested_thumbnail_width || $max_height < $this->_requested_thumbnail_height) || (KISS_DISABLE_UPSIZE == 'true' && ($this->_width < $max_width || $this->_height < $max_height)) ) {

 

Hi Rainer

 

Its perfect now.

 

Many thanks for the contrib and your help.

 

regards

 

naf



#273 ONLINE   greasemonkey

greasemonkey
  • Members
  • 727 posts
  • Real Name:Scott
  • Gender:Male

Posted 09 June 2015 - 15:48

@raiwa I'm not sure if you can help with this... And I'm not sure if this is a bug.

 

I've noticed the title="" and alt="" is not being populated.

 

The output is (example from my BS site);

<img width="600" height="600" src="includes/modules/kiss_image_thumbnailer/thumbs/600x600_MYIMAGE.jpg" title="" alt="" class="img-responsive" id="piGalImg_1" /><img width="600" height="600" src="includes/modules/kiss_image_thumbnailer/thumbs/600x600_MYIMAGE 2.png" title="" alt="" class="img-responsive" id="piGalImg_2" />

Looking at my 2.3.4 live store it would seem to have the same issue.... However Gary's store it outputs fine; http://www.template....4&products_id=1. Thinking it comes from product info ; addslashes($product_info['products_name'])?????

      <img src="images/matrox/mg200mms.gif" alt="Matrox G200 MMS" title="Matrox G200 MMS" width="100" height="80" class="img-responsive" />

It would seem to be these lines in html_output.php

// alt is added to the img tag even if it is null to prevent browsers from outputting
// the image filename as default
    $image = '<img src="' . tep_output_string($src) . '" alt="' . tep_output_string($alt) . '"';

    if (tep_not_null($alt)) {
      $image .= ' title="' . tep_output_string($alt) . '"';
    }

Specifically $alt is not being returned from tep_image_legacy?????

 

This all started with my trying to add a title to the ht_product_colorbox.php script (but can't seem to figure out how to add..... :( :( :( :( :( )

title: '<?php echo $product_info['products_name']; ?>',


#274 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted 09 June 2015 - 17:14

Hello Scott @greasemonkey,

 

The alt and title tag is shown in product_info.php the same with and without kissit image thumbnailer.

Fact is that it shows if only one image (product image) is used.

It doesn't show if additional big images are used.

See in Gary's BS demo:

http://www.template....?products_id=28

 

regards

Rainer



#275 ONLINE   greasemonkey

greasemonkey
  • Members
  • 727 posts
  • Real Name:Scott
  • Gender:Male

Posted 10 June 2015 - 21:40

@raiwa Ok thanks Rainer.... now back to issue of adding the title under the large image...



#276   nafri

nafri
  • Members
  • 174 posts
  • Real Name:naf

Posted 03 July 2015 - 12:11

itemprop="image  links to the thumbnailed image.. any chance i can ge it to link to the main image..

 

Also can i increasse the compression on the images..


Edited by nafri, 03 July 2015 - 12:24.


#277   vampirehunter

vampirehunter
  • Members
  • 541 posts
  • Real Name:vampire

Posted Yesterday, 15:09

Is there a way to integrate an automatic watermark with this?

 

im looking to have a watermark added each time an image is generated.

 

thanks



#278 ONLINE   raiwa

raiwa
  • Community Sponsor
  • 846 posts
  • Real Name:Rainer Schmied
  • Gender:Male
  • Location:Sant Iscle de Vallalta, Barcelona, Spain

Posted Yesterday, 15:18

@vampirehunter,

 

newest version r14 includes watermark


Edited by raiwa, Yesterday, 15:19.