[ 
http://jira.magnolia.info/browse/MGNLIMG-25?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125#action_18125
 ] 

Frank Sommer commented on MGNLIMG-25:
-------------------------------------

{code}
...
   /**
     * @param storageNode where the resized image should be stored
     * @param dialogControlConfigNode where the control is configured (for 
targetWidth and targetHeight)
     */
    public void processImages(Content storageNode, Content 
dialogControlConfigNode) throws RepositoryException, IOException {
        // let'name loop through all properties, see which ones are binaries 
and see if they have a corresponding cropperInfo
        int index = dialogControlConfigNode.getName().indexOf("Crop");
        String imageName = dialogControlConfigNode.getName().substring(0, 
index);
        NodeData image = storageNode.getNodeData(imageName);
        if (image != null) {
            final String targetBinaryProperty = 
CropAndResizeControl.getTargetBinaryPropertyName(imageName);
            if (image.getType() == PropertyType.BINARY) {
                final String potentialCropperInfoProperty = 
CropAndResizeControl.getCropperInfoPropertyName(imageName);
                if (storageNode.hasNodeData(potentialCropperInfoProperty)) {
                    final NodeData filteringParams = 
storageNode.getNodeData(potentialCropperInfoProperty);
                    final NodeData target = 
NodeDataUtil.getOrCreate(storageNode, targetBinaryProperty, 
PropertyType.BINARY);
                    processImage(image, filteringParams, target, 
dialogControlConfigNode);
                }
            } else if (storageNode.hasNodeData(targetBinaryProperty)) {
                // deletes the thumbnail and the cropper info node
                storageNode.deleteNodeData(targetBinaryProperty);
                String cropperNodeName = 
CropAndResizeControl.getCropperInfoPropertyName(imageName);
                if (storageNode.hasNodeData(cropperNodeName)) {
                    storageNode.deleteNodeData(cropperNodeName);
                }
            }
        }
    }
...
{code}

> Remove crop/preview when removing file/binary
> ---------------------------------------------
>
>                 Key: MGNLIMG-25
>                 URL: http://jira.magnolia.info/browse/MGNLIMG-25
>             Project: Magnolia Image Filtering Module
>          Issue Type: Improvement
>            Reporter: Gregory Joseph
>            Assignee: Gregory Joseph
>             Fix For: 1.0
>
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to