You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.
I am trying to use the "crop" script on my website for generating thumbnails of panoramic pictures. I observe a very strange result (but maybe normal) when I use "CropEntropy". My goal is to extract a thumbnail with random size for many pictures (for building a mosaic).
My approach is:
I resize (if necessary) my pictures using Imagick (I specify a maximum width of height of 4000px because panoramic pictures are really huge). These pictures can be consider as reference pictures.
I resize these pictures for generating thumbnails using Imagick (maximum height=400px).
I use the "CropEntropy" function on the 400px pictures for extracting thumbnails using a box that I have computed the size (the height of the thumbnail will be equal to H=0.7*400 and the width (W) will be randomly chosen between two values (400 and 1000px in my case)).
For the third point, I use the following syntax (where $image is the 400px picture):
$cropperEntropy = new stojg\crop\CropEntropy($image);
$croppedImage = $cropperEntropy->resizeAndCrop(intval($DimCropWidth),intval($DimCropHeight));
$croppedImage->writeimage($ImageNameCrop);
Using this process, I obtain a HxW picture (height H, width W) but the function resize the original 400px-picture for obtaining a picture with a height of H. Maybe this issue is normal but in my case, I have commented the line "$this->originalImage->resizeImage($crop['width'], $crop['height'], \Imagick::FILTER_CUBIC, .5);" in the Crop.php file for avoiding this and obtaining crop picture with not the whole height of my orginal picture.
I don't know if I am very clear but maybe it can be interresting to correct this issue (if it is one) or adding the possibility of extracting one box inside of a picture (with not the whole height of the original picture).
The issue seems to come from the "getSafeResizeOffset" function that fixes the cropping height to $targetHeight in my case.
The text was updated successfully, but these errors were encountered:
I took a swing at this tonight, but couldn't make much progress. Could you supply a fully functional code to reproduce what you're talking about, as well as a sample image? I think that'll be the most direct way to ensure we're all on the same page.
I am trying to use the "crop" script on my website for generating thumbnails of panoramic pictures. I observe a very strange result (but maybe normal) when I use "CropEntropy". My goal is to extract a thumbnail with random size for many pictures (for building a mosaic).
My approach is:
For the third point, I use the following syntax (where $image is the 400px picture):
$cropperEntropy = new stojg\crop\CropEntropy($image);
$croppedImage = $cropperEntropy->resizeAndCrop(intval($DimCropWidth),intval($DimCropHeight));
$croppedImage->writeimage($ImageNameCrop);
Using this process, I obtain a HxW picture (height H, width W) but the function resize the original 400px-picture for obtaining a picture with a height of H. Maybe this issue is normal but in my case, I have commented the line "$this->originalImage->resizeImage($crop['width'], $crop['height'], \Imagick::FILTER_CUBIC, .5);" in the Crop.php file for avoiding this and obtaining crop picture with not the whole height of my orginal picture.
I don't know if I am very clear but maybe it can be interresting to correct this issue (if it is one) or adding the possibility of extracting one box inside of a picture (with not the whole height of the original picture).
The issue seems to come from the "getSafeResizeOffset" function that fixes the cropping height to $targetHeight in my case.
The text was updated successfully, but these errors were encountered: