Hello,
i have 10 images in gallery 2.
All images have the next resolutions: 1024x768, 800x600, 600x400.
I need to download in a zip the images in a different resolutions.
It's possible?
Thnks
Gallery version (not just "2"):2.1.1
PHP version (e.g. 4.3.11):5.0.5 isapi
Webserver (e.g. Apache 1.3.33):Microsoft-IIS/5.0
Database (e.g. MySql 4.0.11):mysql 4.1.18-nt, lock.system=database
Activated toolkits (e.g. NetPbm, GD):NetPbm, GD, ImageMagick
Operating system (e.g. Linux):WIN 2000 Server
Browser (e.g. Firefox 1.0):1.5.0.6
Posts: 8601
no, the zip cart module always selects the largest size you have permission to view.
you'd have to modify modules/zipcart/classes/ZipCartPlugin.class to select a specific size.
Posts: 13
very much thanks mindless i go to look that class bye ;)
I think this is the code:
foreach ($resizes[$itemId] as $resize) { $size = $resize->getDerivativeSize(); if (!isset($maxSize) || $size > $maxSize) { $item = $resize; $maxSize = $size; } }but for do that i think its necessary to add a new col or field in viewcart.tpl "Size" because i can select the same image in different sizes and this is 2 lines in viewcart.tpl.
Its possible? or very hard?
Posts: 13
I think i need add a field "size" on the cart.
Where G2 store the information of the Cart? Can i add a field?
After (in viewcart.tpl) show that in a column.
Posts: 8601
you'll have to modify the cart module, but you can do that...
Posts: 5
I also need it, i watched for the cart module and i dont know how to pick up the size
Posts: 2
Hi i also need for a important project
Posts: 8601
http://gallery.menalto.com/sfvote/all -- if you don't see this request listed there, you can file a request on sf.net and then vote for it in sfvote once it syncs over (~half a day).
Posts: 2
ok do
Posts: 5
i think,in this source it's possible render image witdh function render of galleryDerivativeImage.class?
foreach ($resizes[$itemId] as $resize) {
$size = $resize->getDerivativeSize();
if (!isset($maxSize) || $size > $maxSize) {
$item = $resize;
$maxSize = $size;
}
}
what do you think this?
Posts: 5
how i do this?
Posts: 5
i can resize image width this:
$anchura=800;
$hmax=600;
copy($ruta,$nombre);
$archivoCop=basename($nombre);
$archivoCop="pp_".$archivoCop;
$datos = getimagesize($nombre);
if($datos[2]==1){$img = @imagecreatefromgif($nombre);}
if($datos[2]==2){$img = @imagecreatefromjpeg($nombre);}
if($datos[2]==3){$img = @imagecreatefrompng($nombre);}
$ratio = ($datos[0] / $anchura);
$altura = ($datos[1] / $ratio);
if($altura>$hmax){$anchura2=$hmax*$anchura/$altura;$altura=$hmax;$anchura=$anchura2;}
$thumb = imagecreatetruecolor($anchura,$altura);
imagecopyresampled($thumb, $img, 0, 0, 0, 0, $anchura, $altura, $datos[0], $datos[1]);
if($datos[2]==1){header("Content-type: image/gif"); imagegif($thumb,$camino[0]."tmp/".$archivoCop);}
if($datos[2]==2){header("Content-type: image/jpeg");imagejpeg($thumb,$camino[0]."tmp/".$archivoCop);}
if($datos[2]==3){header("Content-type: image/png");imagepng($thumb,$camino[0]."tmp/".$archivoCop); }
copy($camino[0]."tmp/".$archivoCop,$original);
unlink($camino[0]."tmp/".$archivoCop);
unlink($nombre);
Posts: 5
i put this in the zipcart.class i need send the size to the cart and send the cart from a zipcart