1

We have a custom import tool that programmatically imports content into a Sitecore 8.2 (rev. 170614) instance. In addition to the content, images are imported and attached to items as they are created. So far so good.

The images in the media library are just fine after import, however there are some renderings (such as a 'related products' list) that render images using @Editable(ProductSubTechType, x => x.TechTypeImage) (the model and property; we're not using Glass)

These resized images have a black background, which is Sitecore's default behaviour for resizing non-transparent images on request (which these are). However I can't get the black background to go away.

I've tried patching the config like so: -

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <settings> <setting name="Media.DefaultImageBackgroundColor" value="White" />

No dice (tried #FFFFFF as well). Also tried replacing the @Editable component in the view: -

@Html.Sitecore().Field("TechTypeImage", new { bc = "White" })

Same thing.. the black background is still there, which in this case is not what we want.

Any ideas ?

4
  • 1
    It looks media cache related issue, can you try by removing/disable the media cache or passing the dmc parameter in @Html.Sitecore().Field? Jun 15 '20 at 7:13
  • Hi, thanks for responding. I tried that and I get the same result unfortunately. It's definitely not a front-end issue, if I request the image by pasting the URL into the browser I get a resized image with a black background.
    – sh1rts
    Jun 16 '20 at 1:16
  • Can you check from your showconfig.aspx page if the setting Media.DefaultImageBackgroundColor is set to white? It may be that you have another setting overriding this one because the background is still in black Jun 16 '20 at 7:07
  • I did a showconfig, it was showing White
    – sh1rts
    Jun 18 '20 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.