Estira, redimensiona o miniatura una imagen usando Perl
-
20-08-2019 - |
Pregunta
¿Cómo puedo estirar o redimensionar una imagen (de cualquier formato) usando un script Perl?
Solución
Recomiendo Image :: Imlib2 ... si puede instalar imlib2 en su máquina
Ver documentación: Image :: Imlib2
use Image::Imlib2;
# load image from file
my $image = Image::Imlib2->load("in.png");
# get some info if you want
my $width = $image->width;
my $height = $image->height;
# scale the image down to $x and $y
# you can set $x or $y to zero and it will maintain aspect ratio
my $image2 = $image->create_scaled_image($x,$y);
# save thumbnail to file
$image2->save("out.png");
También podría estar interesado en Imagen :: Imlib2 :: Miniatura , si no puede instalar imlib2, eche un vistazo a Imagen :: Magia
Otros consejos
Puede usar Image :: Resize .
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow