use of org.alfresco.service.cmr.repository.CropSourceOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsCrop.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsCrop() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
CropSourceOptions cropOptions = new CropSourceOptions();
oldOptions.addSourceOptions(cropOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, resizeOptions=null, autoOrient=false], " + "sourceOptions={ CropSourceOptionsCropSourceOptions " + "[height=-1, width=-1, xOffset=0, yOffset=0, isPercentageCrop=false, gravity=null]} ]", "cropXOffset=0 " + "cropYOffset=0 " + "timeout=-1 ", true);
}
use of org.alfresco.service.cmr.repository.CropSourceOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsCropPercentage.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsCropPercentage() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
CropSourceOptions cropOptions = new CropSourceOptions();
cropOptions.setPercentageCrop(true);
oldOptions.addSourceOptions(cropOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, resizeOptions=null, autoOrient=false], " + "sourceOptions={ CropSourceOptionsCropSourceOptions " + "[height=-1, width=-1, xOffset=0, yOffset=0, isPercentageCrop=true, gravity=null]} ]", "cropPercentage=true " + "cropXOffset=0 " + "cropYOffset=0 " + "timeout=-1 ", true);
}
Aggregations