Glpi error displaying jpg documents

Hi all I have a problem with GLPI regarding the loading of documents in particular by loading an image type file. Here’s what I see:


Schermata 2021-07-10 alle 09.55.52
Also I have tried with different browsers in the doubt that Safari has problems in displaying the types of images, but nothing to do.

Did you change the URL to reach GLPI?

https://forum.glpi-project.org/viewtopic.php?id=173109

Inside Database table glpi_computermodels there are 2 columns: picture_front, picture_rear.
Check that value and if it’s working.

Hi Markuz, I’m sending you screenshots. The attached documents only work in .pdf formats .png .jpeg images. jpg not, the url address above the bar is always the same. A few days ago I managed to see an error of the type “malformed file” .eccc in the logs

Hm, there are no columns as described in the thread.

You may check the GLPI page in the browser console to see if the URI to the picture is the right one or if there are other errors…

I’m going to try to reproduce later or tomorrow…

1 Like

The url is the correct one, which is the path to the server. It is the same because as written before the pdf is opened regularly. Comuqneu thanks for taking charge of the problem.

I think I could reproduce the issue. In Firefox I get

and in Chrome I just get a small white image when viewing a jpg:

image

Here I found that PHP is sensible about blank lines so I checked the config_db.php and found one at the end.

Please remove the blank line(s) at the end of /etc/glpi/config_db.php and test if an image is displayed.
To make it permanent edit /etc/e-smith/templates/etc/glpi/config_db.php/10base and change the end of the file from:

...
 var \$dbdefault = 'glpi';

 }
?>
);
}

to

...
 var \$dbdefault = 'glpi';

 }
?>);
}

Apply config:

signal-event nethserver-glpi-update

4 Likes

Incredible! I would not have imagined this solution, now it works perfectly. Congratulations for the solution and above all for taking care of the problem! Thanks so much !

You’re welcome. I think this is a bug. @stephdl should I open a PR?

1 Like

Well, in my opinion it is appropriate to point this out. Considering that you have made tests with the same result as mine or the image was not displayed. However, the pdfs worked and worked. even before. This should be reported to Stephan.

2 Likes


2 Likes

Yes please do it, will try to review and build but no laptop until 2 august

3 Likes
4 Likes

Thank you mate

3 Likes

Hi, by the way, from what is highlighted by mmarkuz for viewing images, I noticed that uploading images of user profiles now works, an operation that could not be done before. So the problem beyond viewing documents related to images jp or something else, it didn’t work other than uploading user profile photos.

1 Like

released, thank @mrmarkuz @france

2 Likes