use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsCropOffset.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsCropOffset() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
CropSourceOptions cropOptions = new CropSourceOptions();
cropOptions.setXOffset(20);
cropOptions.setYOffset(59);
oldOptions.addSourceOptions(cropOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, resizeOptions=null, autoOrient=false], " + "sourceOptions={ CropSourceOptionsCropSourceOptions " + "[height=-1, width=-1, xOffset=20, yOffset=59, isPercentageCrop=false, gravity=null]} ]", "cropXOffset=20 " + "cropYOffset=59 " + "timeout=-1 ", true);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testResize.
// ImageTransformationOptions [commandOptions=, resizeOptions=ImageResizeOptions [width=20, height=30, maintainAspectRatio=true, percentResize=false,
// resizeToThumbnail=false, allowEnlargement=true], autoOrient=true], sourceOptions={ PagedSourceOptionsPagedSourceOptions {1, 1}} ]
@Test
public void testResize() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
imageResizeOptions.setAllowEnlargement(false);
imageResizeOptions.setWidth(20);
imageResizeOptions.setHeight(30);
oldOptions.setResizeOptions(imageResizeOptions);
PagedSourceOptions pagedSourceOptions = new PagedSourceOptions();
pagedSourceOptions.setStartPageNumber(1);
pagedSourceOptions.setEndPageNumber(1);
oldOptions.addSourceOptions(pagedSourceOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, " + "resizeOptions=ImageResizeOptions [width=20, height=30, maintainAspectRatio=true, " + "percentResize=false, resizeToThumbnail=false, allowEnlargement=false], autoOrient=true], " + "sourceOptions={ PagedSourceOptionsPagedSourceOptions {1, 1}} ]", "allowEnlargement=false " + "autoOrient=true " + "endPage=0 " + "resizeHeight=30 " + "resizeWidth=20 " + "startPage=0 " + "timeout=-1 ", true);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions 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.repo.content.transform.magick.ImageTransformationOptions 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);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsResize.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsResize() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
oldOptions.setResizeOptions(imageResizeOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, " + "resizeOptions=ImageResizeOptions [width=-1, height=-1, maintainAspectRatio=true, " + "percentResize=false, resizeToThumbnail=false, allowEnlargement=true], autoOrient=false]]", "timeout=-1 ", true);
}
Aggregations