Copied to clipboard

Flag this post as spam?

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


  • Danny Blatant 91 posts 358 karma points
    Oct 06, 2014 @ 12:24
    Danny Blatant
    0

    Umbraco 7 : Swapping image file in Media breaks image

    Hi all,

    I believe this is a bug however please move this post if I'm in error.

    What I have is a Document Type that accepts a Media Picker field. This Media Picker has a Media File selected. This file for example is called image1.png.

    WHat I do is edit the origional image file, perhaps adding a transparent background, and I then save the image as image1.png. Then I goto Umbraco back end and locate the file in Media, I remove the existing image and upload the new one.

    This works from the back end view, I save the Media file. I have Image Cropper installed so I make sure to 'touch' the center crop marker before saving. I then goto the Document Type and re-save and publish just in case.

    Now when I go to the front end the image file does not display, it is a null. Here's the code I use to display (I iterate the DocTypes to build a list view of the images) :

    JObject awardImage = Umbraco.TypedMedia((int)award.GetPropertyValue("image")).GetPropertyValue<JObject>("umbracoFile");
    

    Here the updated Media in question (awardImage) is NULL. Curiously Rebuilding and cleaning the application does not fix it, however I can add a new image file to Media and change the DocType field to the new file without problems...

    Is this a bug with the cache refreshing? perhaps it's becasue I uploaded a different image with the same name so something didn't stick?

    I can try deleting the umbraco.config to force a refresh however this isn't practical when handed over to the client and they manage thier images.

    Any feedback or input is greatly appriciated!

    Danny "Blatant"

  • Danny Blatant 91 posts 358 karma points
    Oct 06, 2014 @ 12:31
    Danny Blatant
    0

    Weird, I am now unable to reproduce!

    Sorry to have bothered you.

Please Sign in or register to post replies

Write your reply to:

Draft