Author Topic: Additional Images: thumb-Images and no resize  (Read 3495 times)

dokape

  • Beginner
  • *
  • Posts: 20
Additional Images: thumb-Images and no resize
« on: December 20, 2008, 15:54:17 pm »
Hi,

Virtuemart 1.1.2 at joomla 1.5.7

The images should appear directly in original size (the product image and the additional images)

To show the product image I wrote a small function, works fine.
But the additional images are making me mad:

In the product-template the additional images are called by that line:

echo $this->vmlistAdditionalImages( $product_id, $images )

In the vmlistAdditionalImages() at the file theme.php,

we find that line:

$thumbtag = ps_product::image_tag( $image->file_name, 'class="browseProductImage"', 1, 'product', $image->file_image_thumb_width, $image->file_image_thumb_height );

I change the 1 to 0, because I do not wan't the images to be resized.

But at file ps_product.php the image_tag() - function calls the
getimagesize() function and drops a Warning, that the stream could not be opened.
Well, the URL contains a http://<servername>//component instead of only one slash,
ok. no problem, a second str_replace can suppress this, but getimagesize does still not work properly.
chmod to 0777 does not help.
The image is shown! The shown url at the warning is all right.
Perhaps this function should be changed to work with absolute path instead of URL?

Thanks for reading (hope, anyone did understand what I wan't so say...)
Peter

saunte

  • Beginner
  • *
  • Posts: 7
Re: Additional Images: thumb-Images and no resize
« Reply #1 on: January 02, 2009, 19:47:33 pm »
One suggestion - if storage size is not a problem you can trick the system by copying the image files to /components/com_virtuemart/shop_image/product/resized directory with "_90x90" appended to the filename.

If you have changed the default thumbnail size you need to use this instead (see administration-admin-configuration-site thumbnail size), i.e. if you have set it to 120 x 120 you need to append "_120x120" to the filename.

There seems to be several "bugs" as you may generate thumbnails when uploading - but these are not used (get i.e. extension _90x54, but the system makes a new _90x90 even though the size 90x54 is recorded in the tables).

My thumbnails are generated seperately so therefore I had to trick the system as well.

Nyctophilic

  • Beginner
  • *
  • Posts: 6
Re: Additional Images: thumb-Images and no resize
« Reply #2 on: August 13, 2010, 06:14:18 am »
Hi,

Sorry to reopen such an old post. The thumbnails for the additional images are pointing to a url with an extra slash after the domain www.domain.com//components/....

The additional images show up in the lightbox just fine, but where is the trailing slash coming from?? and how can I remove it?

In the database --> #_vm_product_files --> file_url has the extra slash http://domain.com//components/...

I think if I manually changed the urls, the extra slash will be removed. But, why is it generated from the beginning? There should be a typo somewhere. Any help?

If it's not just a typo, would you please clarify how str_replace can be used to remove the extra slash. Sorry, but I am new to php.

Thanks