mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
FIXED : ALF-10578: iPad uploaded files appear upside down in share preview
Defaults to auto-orient images based on EXIF info git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32539 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -229,6 +229,17 @@ public class ImageRenderingEngine extends AbstractTransformationRenderingEngine
|
||||
*/
|
||||
public static final String PARAM_COMMAND_OPTIONS = "commandOptions";
|
||||
|
||||
/**
|
||||
* This optional {@link Boolean} flag parameter specifies if the engine should
|
||||
* automatically rotate and image based on the EXIF orientation flag. If
|
||||
* this parameter is set to <code>true</code> then the engine reads
|
||||
* and resets the EXIF image profile setting 'Orientation' and then performs
|
||||
* the appropriate 90 degree rotation on the image to orient the image,
|
||||
* for correct viewing.
|
||||
* This parameter defaults to <code>true</code>.
|
||||
*/
|
||||
public static final String PARAM_AUTO_ORIENTATION = "autoOrientation";
|
||||
|
||||
/*
|
||||
* @seeorg.alfresco.repo.rendition.executer.ReformatRenderingEngine#
|
||||
* getTransformOptions
|
||||
@@ -242,9 +253,12 @@ public class ImageRenderingEngine extends AbstractTransformationRenderingEngine
|
||||
ImageResizeOptions imageResizeOptions = getImageResizeOptions(context);
|
||||
ImageCropOptions cropOptions = getImageCropOptions(context);
|
||||
|
||||
boolean autoOrient = context.getParamWithDefault(PARAM_AUTO_ORIENTATION, true);
|
||||
|
||||
ImageTransformationOptions imageTransformationOptions = new ImageTransformationOptions();
|
||||
imageTransformationOptions.setResizeOptions(imageResizeOptions);
|
||||
imageTransformationOptions.setCropOptions(cropOptions);
|
||||
imageTransformationOptions.setAutoOrient(autoOrient);
|
||||
if (commandOptions != null)
|
||||
{
|
||||
imageTransformationOptions.setCommandOptions(commandOptions);
|
||||
@@ -359,6 +373,10 @@ public class ImageRenderingEngine extends AbstractTransformationRenderingEngine
|
||||
protected Collection<ParameterDefinition> getParameterDefinitions()
|
||||
{
|
||||
Collection<ParameterDefinition> paramList = super.getParameterDefinitions();
|
||||
|
||||
//Orientation
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_AUTO_ORIENTATION, DataTypeDefinition.BOOLEAN, false,
|
||||
getParamDisplayLabel(PARAM_AUTO_ORIENTATION)));
|
||||
|
||||
//Resize Params
|
||||
paramList.add(new ParameterDefinitionImpl(PARAM_RESIZE_WIDTH, DataTypeDefinition.INT, false,
|
||||
|
Reference in New Issue
Block a user