Copied to clipboard

Flag this post as spam?

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

  • Dav 44 posts 69 karma points
    May 30, 2011 @ 15:16

    Where in code does Umbraco generate thumbnails?

    Been drowning in code for a while and I'm stuck. We'd like to change the thumbnail generation code so that it can properly handle PNG32 files with opacity, and at the same time learn something new about Umbraco. We quickly came across UmbracoImageMediaFactory and the GenerateThumbnail method inside... only to put the celebratory cake away minutes later.

    No matter what we do inside the GenerateThumbnail method, it doesn't seem to get called at all. In fact, VS2010 finds no usings of the UmbracoImageMediaFactory class! We resorted to putting throw new Exception(s) around, and they too don't pop up whenever we save an image.

    It seems that code goes through but these are general media-related methods.

    Curiosity is eating us bad now - where does v4.7 generate the actual thumbnails? Any pointers will be more than welcome!

  • Dav 44 posts 69 karma points
    May 30, 2011 @ 15:26

    Eureka! Found it in a moment of revelation: a search for "Graphics" revealed the culprit... if you ever need to have your jpg thumbnails display PNGs on a white background (a little saner than the default black), just add g.Clear(Color.White) around line 318 in umbraco.editorControls.uploadField.generateThumbnail(...).

  • Ian 32 posts 82 karma points
    Feb 26, 2013 @ 18:24

    Which version of the uploadField are you referring to? There's this one in the Umbraco source...

    Its not easy to duplicate due to its dependencies.

    Then I found this one...

    .. by googling, 'umbraco.editorControls.uploadField.generateThumbnail' (from your post).

    But that doesn't contain 318 lines!


  • Bipin Kataria 29 posts 60 karma points
    Jul 26, 2016 @ 01:35
    Bipin Kataria

    If you want thumbnail in Media section for SVG file, just add below code in umbracoSettings.config > Content tag:


    <!-- what file extension that should cause umbraco to create thumbnails -->



Please Sign in or register to post replies

Write your reply to: