[MGNLIMG-25] Remove crop/preview when removing file/binary Created: 27/Jun/07  Updated: 05/Dec/13  Resolved: 05/Dec/13

Status: Closed
Project: Imaging
Component/s: crop ui
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Magnolia International Assignee: Magnolia International
Resolution: Obsolete Votes: 0
Labels: verify
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
dependency
depends upon MGNLIMG-5 Implement a SaveHandler that does the... Closed
Template:
Patch included:
Yes
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

This is maybe not valid anymore with 2.0, to be validated



 Comments   
Comment by Frank Sommer [ 24/Sep/08 ]

We have fix this issue and some further bugs for us. How can I contribute the changes to the module and the community?

Comment by Frank Sommer [ 24/Sep/08 ]
...
   /**
     * @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);
                }
            }
        }
    }
...
Comment by Magnolia International [ 24/Sep/08 ]

Hi Frank, thanks, awesome !
I'll check this one in asap; in general, have a look at : http://documentation.magnolia.info/contribute.html#Createpatches
In short, create patch files from the root of the project/module against the latest revision (that makes it way easier for us to apply) and attach them to a jira issue describing the issue/fix is how you get the most chances for your fixes to be included

Comment by Magnolia International [ 26/Sep/08 ]

Frank,

I'm afraid I'm not going to be able to use this patch: MGNLIMG-5 will probably completely change the way this is working.
Thanks though, keep 'em coming !

Comment by Christopher Zimmermann [ 05/Dec/13 ]

Crop UI has been superceded by 5 series image editor.

Generated at Mon Feb 12 02:11:32 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.