VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Virtuemart 1.1 Development (Archiv) => Quality & Testing VirtueMart 1.1.x => Topic started by: mauri on March 19, 2008, 18:11:57 PM

Title: [TRACKER 1929, 1930]When use full image URL, you cant use Auto-Create Thumbnail
Post by: mauri on March 19, 2008, 18:11:57 PM
Quote from: gregdev on March 09, 2008, 03:23:31 AM
QuoteI 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


/* 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
        );
      


/* 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
        );

    }
Title: Re: if you use full image URL, you cant use Auto-Create Thumbnail
Post by: mauri on March 19, 2008, 20:32:41 PM
In imageTools.class.php :

$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:
$fileout = IMAGEPATH.$table_name.'/resized/'.$to_file_thumb.'_'.PSHOP_IMG_WIDTH.'x'.PSHOP_IMG_HEIGHT.$noimgif.$ext;


Title: Re: if you use full image URL, you cant use Auto-Create Thumbnail
Post by: mauri on March 20, 2008, 18:58:40 PM
Iam not sure, but I think this is bug too.
In ps_product.php:

// 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:
// 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") {
Title: Re: [TRACKER 1929, 1930]When use full image URL, you cant use Auto-Create Thumbnail
Post by: mango10 on April 09, 2009, 20:15:20 PM
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??
Title: Re: [TRACKER 1929, 1930]When use full image URL, you cant use Auto-Create Thumbnail
Post by: mango10 on April 09, 2009, 20:31:22 PM
Ok I just found out, that it works when you delete the link :) Perfect :)
Title: Re: [TRACKER 1929, 1930]When use full image URL, you cant use Auto-Create Thumbnail
Post by: aravot on April 17, 2009, 23:26:38 PM
The problem with this code 'if (substr( $temp_file, 0, 4) == "/tmp")' is regular upload of large images don't work.