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:
Alan Davis
2021-05-11 13:48:09 +01:00
committed by GitHub
parent 0c94df6e43
commit 5de64aefa9
2 changed files with 24 additions and 8 deletions

View File

@@ -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 ");
}
}