PNG's a no show

(Susan Spencer) #1

Our forum is having problems displaying images. Sometimes they show, but most of the time they don’t. Not sure how to track this down, our image max display size is 860x860, max upload size is 4M.
Here is a thread which shows the difficulties:

(Susan Spencer) #2

Hi! We love the Discourse software, our users are really helping each other quite a lot.
We use a lot of screenshots (.png, .svg) and other images to provide software support.
So it’s unfortunate that we’ve sort of hit some snags with displaying images.

Here’s an example. I’ve posted two .svg files. These files exist under the uploads directory tree, and the posts’ links to these files are correct. But the .svg files aren’t being displayed. When weright click on the empty boxes to open in a new tab or copy the image address we get this url: /images/transparent.png.

(Jeff Atwood) #3

Do they work here? Please upload an example here.

(Susan Spencer) #4

Yeah we already know that there’s an issue on our forum, but we can’t pinpoint what caused it. We’re on digital ocean, running ubuntu 14.04, and have an SSL cert.

Interesting, this svg file doesn’t work here, but the next svg file at the end of this post displays here properly. Neither of these svg files are displaying on our forum.
Logo-400.svg, 500 x 377 in (upload://vV2kqp94XodzHtRWyekld9ibchs.svg)

Here’s the Logo-400.svg from a screenshot in the default image viewer on Ubuntu 16.04:

BlueJazClub.jpg, 281x499 in (upload://fTxzpJHb9e9OjOQ4SXMYMy4Lwx.jpg)

bustpoint_to_shoulder_center.svg, 258x500, in (upload://1qpJmc9XhEzv6e3oyPwZabZthcA.svg)

(Susan Spencer) #5

Here is an SVG with a solid white background and includes an image:
FTB_EpicMod.svg, | 320x352 in (upload://2Af3Xa8MUy2FNBGSzhqYCIfaI9k.svg)
Doesn’t display.

Same file, removed the image, added a grey square, displays fine.

This is possibly a separate problem from .png no-show.

(Susan Spencer) #6

The BluJazClub.jpg above which displays on this forum, doesn’t display on our forum:

(Sam Saffron) #7

svg is a quirky format, unless it displays fine in browsers I would not expect it to work at all, also you are going to have to whitelist the format.

Are you running latest?

cd /var/discourse
git pull
./launcher rebuild app

(Jeff Atwood) #8

Svg should not be expected to work in every scenario, because there are many security restrictions on the content. Focus on the regular binary images.

(Susan Spencer) #9

np, I created it as a separate issue, but someone combined that issue into this one, so I just went with it :slight_smile: The binary images are my biggest concern.

(Jeff Atwood) #10

Unless you can repro the binary image issue here, I am not sure how much we can help.

(Susan Spencer) #11

Ok, since you know more about Discourse than I do, could you suggest points along the process where this problem might occur? If you don’t mind, could you walk through the process with me:

  1. File upload/storage: The files are uploaded properly, they exist and there are no errors in the files, they can be accessed manually, etc.
  2. File retrieval: Which Discourse processes retrieve these files? Which log settings could issue error messages about image file retrieval?
  3. File display: Which Discourse processes display the files? Which log settings could issue error messages about image file display?

(Sam Saffron) #12

I think before any of this, can you confirm you are using our official installer? Are you using s3 uploads or standard uploads? Have you ran:

cd /var/discourse
git pull
./launcher rebuild app

(Susan Spencer) #13

Hi @sam, thanks for the suggestion, last night I updated last week’s release via terminal window (cd /var/discourse, git pull, .launcher rebuild app) and the problem still exists. We don’t use Amazon s3 storage.

(Jay Pfaffman) #14

I don’t have any explanations for your problem, but note that you can paste images directly into the composer. You don’t need to first paste into some other application to create and image to then upload.

(Susan Spencer) #15

Got the message that docker version not supported
Installed docker-ce, now is my forum gone?

After running the latest Discourse update a few days ago, clicking the the download icon opens .txt files in a browser instead of downloading them, yet no Discourse settings were changed. Yet now .png files are displaying properly. So a deeper problem is occuring.

I implemented the Discourse/Docker periodic manual full update instructions and watched error messages.

All updates .launcher rebuild app I received an error message that docker 17.05 is not supported, minimum required is 17.06.02. Ubuntu has changed the package name from docker-engine to docker-ce. Is it safe to install docker-ce, as this won’t be an upgrade? Because of the docker version preventing app rebuild, my forum is down. :frowning: What do?

(Sam Saffron) #16

Yes docker ce is what you want to use

(Susan Spencer) #17

Hi @Sam,
Yeah I installed docker-ce, per How Do I upgrade Docker - Ask Ubuntu and How To Install and Use Docker on Ubuntu 16.04 | DigitalOcean

Then ran .launcher rebuild app, which initiated a download of the base Discourse image.
I stopped it, figured this would wipe out my forum files.
Should I let this run?

(Michael Brown) #18

I see a big black square in both the browser and inkscape which matches the source:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape ( -->
<svg xmlns:dc="" xmlns:cc="" xmlns:rdf="" xmlns:svg="" xmlns="" xmlns:xlink="" xmlns:sodipodi="" xmlns:inkscape="" id="svg4206" version="1.1" inkscape:version="0.91 r" width="500" height="377.5" viewBox="0 0 500 377.5" sodipodi:docname="Logo-400.svg">

  <defs id="defs4210"/>

  <g id="g4218">
    <rect y="-53.42" x="-40.32" height="466.8" width="589.4" id="rect4216" style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:3.6222;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"/>


I don’t actually see an image in this file, just a white background. if you still have the original can you check to see if the contents have changed? I see:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape ( -->
<svg xmlns:dc="" xmlns:cc="" xmlns:rdf="" xmlns:svg="" xmlns="" xmlns:xlink="" xmlns:sodipodi="" xmlns:inkscape="" width="320.9mm" height="352.2mm" viewBox="0 0 320.9 352.2" version="1.1" id="svg8" inkscape:version="0.92.2 (unknown)" sodipodi:docname="FTB_EpicMode.svg">
  <defs id="defs2"/>

  <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" transform="translate(44.79,25)">

    <rect style="color:#000000;display:inline;overflow:visible;visibility:visible;opacity:0.3;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.265;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" id="rect944" width="321" height="352.2" x="-44.79" y="-25"/>

(Jay Pfaffman) #19

Yes. Your forum files are safe in /var/discourse/shared/standalone.

(Jeff Atwood) #20

It is best not to muddy the waters even further at this point. Svg gets downgraded a lot if the text content is on our unsafe blacklists. Focus on pngs first.