[FIXED] Image and thumb stored in the same folder + additional thumb in resized

(1/4) > >>

Pixell:
I thought I was seeing double but when I looked in the folder where the full image is stored I could even see a copy of this file but a smaller version (a thumb).
And if I go to the resized folder I could see that there is an additional file there.
So there is totaly of three files.

I saw the problem on the site I was working on, so I then installed a fresh Joomla Version 1.5.9 and Virtuemart 1.1.3 just to confirm that I didn't have messed it up somewhere with the site I was working on.

So I added a new dummy product with a dummy image on the new fresh installation.
The result was the same! It had now created:

/components/com_virtuemart/shop_image/product/
Dummy_Product_499592123f923.jpg (size: 90x79px)Dummy_Product_499592124ded9.jpg (size: 746x663px)
/components/com_virtuemart/shop_image/product/resized/
Dummy_Product_499592123fb2c_90x90.jpg (size: 90x79px)
Can somebody else confirm this?

Jan:
Thats a strange situation.
I think i have the same problem...
I also have some extra files... :-(

salobon:
I have similar problem.
I use V 1.1.3 J1.5.10 and every time I upload image from product edit panel - it created two images in each folder!!!
I looked up the code and figured the problem!
need to modify file:
Code:

/administrator/components/com_virtuemart/classes/imageTools.class.php
I have modified it last night and it works better but not perfect.
here's the contents that I have changed:
this code line69:
Code:

if( @$d[$tmp_field_name.'_action'] == 'auto_resize' ) {
changed with this:
Code:

if(( @$d[$tmp_field_name.'_action'] == 'auto_resize' )&&(strstr($field_name, "thumb" ))) {
line 153-156 was
Code:

}
}
}
}
add this
Code:

}
}
}
return true;
}

!!!!!!!!!!!!!!!!! code above corrects double creation

this part 186-198 commented:
Code:

// if( PSHOP_IMG_RESIZE_ENABLE=="1" && $image_type == "thumbnail image") {
// $pathinfo = pathinfo( $delete );
// isset($pathinfo["dirname"]) or $pathinfo["dirname"] = "";
// isset($pathinfo["extension"]) or $pathinfo["extension"] = "";
// $filehash = basename( $delete, ".".$pathinfo["extension"] );
// $resizedfilename = $pathinfo["dirname"]."/resized/".$filehash."_".PSHOP_IMG_WIDTH."x".PSHOP_IMG_HEIGHT.".".$pathinfo["extension"];
//
//                 $d["image_commands"][] = array( 'command' => 'unlink',
//         'param1' => $resizedfilename
//         );
// $vmLogger->debug( 'Preparing: delete resized thumbnail '.$resizedfilename );
//
// }

this will prevent messed up queries to database that will pass in image_control array
line 248
Code:

$delete = str_replace( "\\", "/", realpath($path)."/".$curr_file);
change with this:
Code:

$delete = str_replace( "\\", "/", realpath($path)."/".$curr_file);

and also comment this:
Code:

// if( PSHOP_IMG_RESIZE_ENABLE=="1" && $image_type == "thumbnail image") {
// $pathinfo = pathinfo( $delete );
// $filehash = basename( $delete, ".".$pathinfo["extension"] );
// $resizedfilename = $pathinfo["dirname"]."/resized/".$filehash."_".PSHOP_IMG_WIDTH."x".PSHOP_IMG_HEIGHT.".".$pathinfo["extension"];
//
//           $d["image_commands"][] = array( 'command' => 'unlink',
//         'param1' => $resizedfilename
//         );
// $vmLogger->debug( 'Preparing: delete resized thumbnail '.$resizedfilename );

// }

last section is commented for same reason as previous - was passing unnecessary and incorrect commands to database query.



Now it work perfect if you upload image and use auto-create thumb.
BUT it still creates unwanted thumb when you upload full image and select "none" for thumb.
I'm ready to answer any questions.

Developer Team,
if you could give me some rights to fix bugs on tracker, I could do some... I know Javascript and PHP, self-taught and ready to help.
I have posted a minor bug ([2638]) at tracker already and would easily fix it myself if I had rights.

aravot:
@salobon, if you want to join the development team please see http://forum.virtuemart.net/index.php?topic=20780.msg95533#msg95533

salobon:
just a quick followup to this problem
If you turn off dynamic thumbnail creation in global config it will stop creating extra thumb in /resize folder.

I have modified file even more efficiently... if anyone id interested I can post a full code here...
Almost 36 lines of code was commented off...

Navigation

[0] Message Index

[#] Next page