Author Topic: [TRACKER 1929, 1930]When use full image URL, you cant use Auto-Create Thumbnail  (Read 3934 times)

mauri

  • Quality&Testing Team
  • Jr. Member
  • *
  • Posts: 297
Quote
I find that if you use full image URL, you cant use Auto-Create Thumbnail?

Correct - it does not work. I am working on it. It appears that it does everything right, then deletes the thumbnail image that was auto-created. So, it can't be that hard to fix - I just haven't found it yet. Will you enter this in the tracker?

Thanks,

Greg

I quote and made new topic, because this is new bug.
I use this to fix:
In imageTools.class.php


Code: [Select]
/* Command to move uploaded file into destination directory */
    // Command to move uploaded file into destination directory
    $d["image_commands"][]= array( 'command' => 'move_uploaded_file',
        'param1' => $temp_file,
        'param2' => $path.$to_file
        );
    $d["image_commands"][] = array( 'command' => 'unlink',
        'param1' => $temp_file
        );
      


Code: [Select]
/* Command to move uploaded file into destination directory */
    // Command to move uploaded file into destination directory
            if (substr( $temp_file, 0, 4) == "/tmp") {
    $d["image_commands"][] = array( 'command' => 'move_uploaded_file',
        'param1' => $temp_file,
        'param2' => $path.$to_file
        );
    $d["image_commands"][] = array( 'command' => 'unlink',
        'param1' => $temp_file
        );

    }
VirtueMart,(Joomla-phpShop, mambo-phpShop) since 2004-03-11

mauri

  • Quality&Testing Team
  • Jr. Member
  • *
  • Posts: 297
Re: if you use full image URL, you cant use Auto-Create Thumbnail
« Reply #1 on: March 19, 2008, 20:32:41 pm »
In imageTools.class.php :

Code: [Select]
$fileout = IMAGEPATH."/$table_name/resized/".$to_file_thumb."_".PSHOP_IMG_WIDTH."x".PSHOP_IMG_HEIGHT.$noimgif.$ext;


Should be no trailing slash , because IMAGEPATH have trailing slash end of it:
$table_name out from quotes:
Code: [Select]
$fileout = IMAGEPATH.$table_name.'/resized/'.$to_file_thumb.'_'.PSHOP_IMG_WIDTH.'x'.PSHOP_IMG_HEIGHT.$noimgif.$ext;


VirtueMart,(Joomla-phpShop, mambo-phpShop) since 2004-03-11

mauri

  • Quality&Testing Team
  • Jr. Member
  • *
  • Posts: 297
Re: if you use full image URL, you cant use Auto-Create Thumbnail
« Reply #2 on: March 20, 2008, 18:58:40 pm »
Iam not sure, but I think this is bug too.
In ps_product.php:

Code: [Select]
// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("product_full_image") && substr( $db->f("product_thumb_image"), 0, 4) != "http") {
Should be:
Code: [Select]
// if we have an uploaded image file, prepare this one for deleting.
if( $db->f("product_full_image") && substr( $db->f("product_full_image"), 0, 4) != "http") {
VirtueMart,(Joomla-phpShop, mambo-phpShop) since 2004-03-11

mango10

  • Jr. Member
  • **
  • Posts: 58
wow, THANK YOU SO MUCH, it was exactly what I was looking for!!!

But I have another problem with full_image_url-pics. Now I can auto-resize them (Thank you so much) but I cannot delete them!! Everything works fine with uploaded images (from directory) but not with url-images.

Maybe someone has an idea??

mango10

  • Jr. Member
  • **
  • Posts: 58
Ok I just found out, that it works when you delete the link :) Perfect :)

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
The problem with this code 'if (substr( $temp_file, 0, 4) == "/tmp")' is regular upload of large images don't work.