Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kevin Jump 1604 posts 10230 karma points MVP 3x c-trib
    Dec 13, 2017 @ 08:12
    Kevin Jump
    0

    Embedded files and packages incorrectly identified as orphaned

    Hi,

    It looks like Media cleaner is only scanning the media items returned by the media service to find orphan items? This means it is missing images that may have been included directly in content.

    For example if you have an image cropper directly on a content item (not best practice I know, but people do it) The image the editor uploads is placed in the media folder but it doesn't appear in the media section.

    Running the scan on the media cleaner shows then shows these image files as orphaned.

    Less likely to be an issue but media cleaner also identifies any files made by creating a package as orphaned. When you create a package inside umbraco it places the package files in the /media/created-packages/ folder.

  • Michele Di Maria 32 posts 234 karma points
    Dec 13, 2017 @ 11:33
    Michele Di Maria
    0

    Hi,

    well... I will have to try to crop an image directly in the content item to see how I can resolve the problem. Or, can you give me an example of "name pattern" of this files?

    About the /media/created-packages/ folder, yes, I didn't give enough importance but you are right, better not to delete it. I will include this change in the next version of MediaClean.

    Thanks,

    Michele

  • Kevin Jump 1604 posts 10230 karma points MVP 3x c-trib
    Dec 13, 2017 @ 11:53
    Kevin Jump
    0

    yeah

    Unfortunately they have the same pattern as a "normal" image, so they will create a /media/number/ folder

    i think the only way to find them will be :

    a) go through the data types (contentTypes Service) and find any with a imageCropper property.

    or

    b) go through all the content to find image cropper properties

    or

    c) go through all the content just looking for media paths with some form of regex.

    bit of a pain really.

  • Michele Di Maria 32 posts 234 karma points
    Dec 25, 2017 @ 10:46
    Michele Di Maria
    0

    Ok, it took a while but I solved it.

    First I generate an XML string that contains all the content (published or not), then I process all the files found as orphan to see if their relative URL appears in the content... if the URL is found, the file is not marked as orphan.

    I will publish it soon.

    Also, the new version will exclude the "created-packages" folder.

    Michele

  • Michele Di Maria 32 posts 234 karma points
    Dec 25, 2017 @ 17:22
    Michele Di Maria
    0

    Ok, feature released in version 0.94. Here the link: https://our.umbraco.org/projects/backoffice-extensions/mediacleaner/

    Michele

Please Sign in or register to post replies

Write your reply to:

Draft