mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
MNT-21694 transform option converter (#444)
* MNT-21694 500 error on new logo upload with Legacy transforms (#284) The TransformationOptionsConverter class did not convert the newer transform option format a Map<String, String> to the legacy ImageTransformationOptions class that contains the commandOption (OPT_COMMAND_OPTIONS) property. As a result no legacy transformer is asked if it can do the transform. Originally not fixed on ACS 7 as Legacy transformers were removed, however the fix was just in the converter class and it is helpful to have identical code on branches if possible.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* #%L
|
||||
* Alfresco Repository
|
||||
* %%
|
||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
||||
* Copyright (C) 2005 - 2021 Alfresco Software Limited
|
||||
* %%
|
||||
* This file is part of the Alfresco software.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
@@ -565,4 +565,18 @@ public class TransformationOptionsConverterTest
|
||||
"timeout=-1 "
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCommandOptionsFromOldOptions()
|
||||
{
|
||||
ImageTransformationOptions oldOptions = new ImageTransformationOptions();
|
||||
oldOptions.setCommandOptions("-resize 350x50> -background none -gravity center");
|
||||
|
||||
assertConverterToMapAndBack(oldOptions, MIMETYPE_IMAGE_JPEG, MIMETYPE_IMAGE_PNG,
|
||||
"ImageTransformationOptions [commandOptions=-resize 350x50> -background none -gravity center, " +
|
||||
"resizeOptions=null, autoOrient=true]]",
|
||||
"autoOrient=true " + // this is a default - so is also set when uploading a logo
|
||||
"commandOptions=-resize 350x50> -background none -gravity center " +
|
||||
"timeout=-1 ");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user