use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsResizeWidthHeight.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsResizeWidthHeight() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
imageResizeOptions.setAllowEnlargement(false);
imageResizeOptions.setMaintainAspectRatio(false);
imageResizeOptions.setWidth(18);
imageResizeOptions.setHeight(15);
oldOptions.setResizeOptions(imageResizeOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, " + "resizeOptions=ImageResizeOptions [width=18, height=15, maintainAspectRatio=false, " + "percentResize=false, resizeToThumbnail=false, allowEnlargement=false], autoOrient=false]]", "allowEnlargement=false " + "maintainAspectRatio=false " + "resizeHeight=15 " + "resizeWidth=18 " + "timeout=-1 ", true);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testCompositeReformatAndResizeRendition.
@Test
public void testCompositeReformatAndResizeRendition() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
imageResizeOptions.setHeight(30);
imageResizeOptions.setWidth(20);
oldOptions.setResizeOptions(imageResizeOptions);
PagedSourceOptions pagedSourceOptions = new PagedSourceOptions();
pagedSourceOptions.setStartPageNumber(1);
pagedSourceOptions.setEndPageNumber(1);
oldOptions.addSourceOptions(pagedSourceOptions);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_JPEG, "ImageTransformationOptions [commandOptions=, resizeOptions=" + "ImageResizeOptions [width=20, height=30, maintainAspectRatio=true, percentResize=false, " + "resizeToThumbnail=false, allowEnlargement=true], autoOrient=true], " + "sourceOptions={ PagedSourceOptionsPagedSourceOptions {1, 1}} ]", "alphaRemove=true " + "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 testImageTransformationOptionsAlphaRemove.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsAlphaRemove() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
// The target mimetype is JPEG, which sets the alphaRemove
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_JPEG, "ImageTransformationOptions [commandOptions=, resizeOptions=null, autoOrient=false]]", "alphaRemove=true " + "timeout=-1 ", true);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsNoAutoOrient.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsNoAutoOrient() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG, "ImageTransformationOptions [commandOptions=, resizeOptions=null, autoOrient=false]]", "timeout=-1 ", true);
}
use of org.alfresco.repo.content.transform.magick.ImageTransformationOptions in project alfresco-repository by Alfresco.
the class TransformationOptionsConverterTest method testImageTransformationOptionsResizeNoEnlargement.
@Test
public // Checks we do what was in the legacy ImageMagickContentTransformerWorker
void testImageTransformationOptionsResizeNoEnlargement() {
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
oldOptions.setAutoOrient(false);
ImageResizeOptions imageResizeOptions = new ImageResizeOptions();
imageResizeOptions.setAllowEnlargement(false);
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=false], autoOrient=false]]", "allowEnlargement=false " + "timeout=-1 ", true);
}
Aggregations