U4-5265 - Resizing an image in the RTE causes black lines around image

Created by Kevin Giszewski 22 Jul 2014, 17:54:13 Updated by Sebastiaan Janssen 27 Feb 2018, 14:51:06

Duplicates: U4-6309

  • Add jpg to media library.
  • Add image to RTE.
  • Resize (upscale a bit)
  • Save

Black lines appear on one or more of the edges of the image. Not as CSS, but as apart of the image.

The lines show in both the front/back end.

The lines do not show in the media library.

3 Attachments


Rasmus Eeg 02 Oct 2014, 07:13:23

I've got the same issue. Except i've got some padding applied to the left or right of the image. Which i think is the cause for my problem.

Kevin Giszewski 16 Jun 2015, 14:49:03

I learned at Code Garden this year that we can set the default color (from black) to white by using a query string parameter. The trick is to inject the bgcolor=fff into each images link.

Rasmus Eeg Møller 16 Jun 2015, 14:52:45

That's not ideal. You would want the image to get cropped not padded.

Kevin Giszewski 16 Jun 2015, 15:01:22

Agreed, but I think it has to do with rounding errors which exposes a false background and is black by default.

Kevin Giszewski 16 Jun 2015, 15:06:31

So the real fix has to do with fixing rounding issues.

James South 16 Jun 2015, 15:54:39

All of the above... Either fix the rounding or use {{mode=crop}}. That second image looks like it has been resized outwith it's aspect ratio so I would suggest crop mode.

Allan Brown 17 Aug 2015, 10:19:51

As a quick fix you can change - var qs = "?width=" + e.width + "px&height=" + e.height + "px"; to - var qs = "?width=" + e.width + "px&height=" + e.height + "px&mode=max";

in these files - \umbraco\js\umbraco.controllers.js \umbraco\js\umbraco.directives.js

Matthew 11 Mar 2016, 20:07:22

My temporary workaround, for an image that does not need resizing, was to add the image in the text editor and then use the html editor to manually remove the width/height query string at the end of the image src attribute. No black line.

Gino Bos 26 Feb 2018, 16:41:13

I noticed this problem is still alive in Umbraco 7.6.13. There are some workarrounds, but neither of them is very pretty. Imho it would be nice if this is going to be fixed in a future update.

James South 27 Feb 2018, 13:41:53

@crixalis It was actually fixed in 7.7.10 https://our.umbraco.org/contribute/releases/7710/

Unfortunately the issue it was linked [U4-6309] to is a duplicate of this one so this has hung around.

@nul800sebastiaan could you close this off please?

James South 27 Feb 2018, 13:44:48

Whoa! I can change the state?!

Sebastiaan Janssen 27 Feb 2018, 14:51:06

@JimbobSquarePants We choose to trust people :-)

Priority: Normal

Type: Bug

State: Duplicate


Difficulty: Normal


Backwards Compatible: True

Fix Submitted:

Affected versions: 7.1.4

Due in version:


Story Points: