Bug 400161 - gwenview failed to open a jpg image file
Summary: gwenview failed to open a jpg image file
Status: RESOLVED DUPLICATE of bug 375641
Alias: None
Product: gwenview
Classification: Applications
Component: general (other bugs)
Version First Reported In: 18.08.2
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-22 17:33 UTC by Nicola Jelmorini
Modified: 2018-11-06 21:23 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
The image file that doesn't open, and the error message (158.32 KB, application/zip)
2018-10-22 17:33 UTC, Nicola Jelmorini
Details
Other images to test the issue (70.75 KB, application/zip)
2018-11-05 17:05 UTC, Nicola Jelmorini
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicola Jelmorini 2018-10-22 17:33:29 UTC
Created attachment 115829 [details]
The image file that doesn't open, and the error message

SUMMARY
I have a jpg image file (see attachment) that gwenview can't open.
I have opened with success the same file on Windows 10, so I think this is not a corrupted format issue.

STEPS TO REPRODUCE
1. click the file in Dolphin
2. gwenview will open
3. instead of the image, an error message shows up (see attachment).


OBSERVED RESULT
Instead of the image, the following error message shows up:
"Loading of "PE363791_S4.JPG" failed.
Loading of additional information failed."


EXPECTED RESULT
The image should appear in the gwenview window.


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Version: 5.14.1
KDE Frameworks Version: 5.51.0
Qt Version: 5.11.1

ADDITIONAL INFORMATION
Comment 1 Patrick Silva 2018-11-05 16:38:45 UTC
Cannot confirm, gwenview 18.08.2 can open PE363791_S4.JPG file on my system.

Operating System: Arch Linux 
KDE Plasma Version: 5.14.2
Qt Version: 5.12.0 beta3
KDE Frameworks Version: 5.51.0
Comment 2 Nicola Jelmorini 2018-11-05 17:05:10 UTC
Created attachment 116106 [details]
Other images to test the issue

Can you try please with the three other images that I have uploaded in the archive "test_jpg.zip"?
Thank you.
Comment 3 Patrick Silva 2018-11-05 17:07:58 UTC
(In reply to VosaXalo from comment #2)
> Created attachment 116106 [details]
> Other images to test the issue
> 
> Can you try please with the three other images that I have uploaded in the
> archive "test_jpg.zip"?
> Thank you.

gwenview shows the three images as expected.
Comment 4 Nicola Jelmorini 2018-11-05 18:51:43 UTC
So, it's possible that on my system something is missing? Some library or plugin?
Gwenview says that the format is not supported. There has to be a difference between your system and mine.
Comment 5 Nicola Jelmorini 2018-11-05 20:02:15 UTC
I run gwenview in a terminal, and these are the messages:

=============================================================================
nicola@nicola-XPS-13-9360:~/Scrivania$ gwenview vitemolla-lampada-da-soffitto-parete__0479971_PE618631_S4.JPG 
Not a JPEG file: starts with 0x00 0x00
QImageReader::read() using format hint "jpg" failed: "Errore sconosciuto"
[Unknown Error]
A bad Qt image decoder moved the buffer to 27533 in a call to canRead()! Rewinding.
QImageReader::read() without format hint failed: "Formato di immagine non supportato"
[Image format not supported]
Not a JPEG file: starts with 0x00 0x00
QImageReader::read() using format hint "jpg" failed: "Errore sconosciuto"
A bad Qt image decoder moved the buffer to 11458 in a call to canRead()! Rewinding.
QImageReader::read() without format hint failed: "Formato di immagine non supportato"
nicola@nicola-XPS-13-9360:~/Scrivania$ 
=============================================================================

So, it seems that there is really a problem with these images. I don't know how you can watch them on your system, nor how can I watch them on my system. It's a mystery :-)
Comment 6 Nicola Jelmorini 2018-11-05 20:22:27 UTC
I have installed Gimp because it's able to "eat" every image formats on Earth, and when I open these images, a window shows up telling me that:

"The image includes a color profile sRGB IEC61966-2.1"

and asking me if I want to convert it to:

"GIMP built-in sRGB"

Either if I chose to convert it, or preserve the original format, Gimp is able to open it. 
Eventually, if I export the image from Gimp in jpeg format, then I can open it with gwenview.
Comment 7 Patrick Silva 2018-11-05 20:28:25 UTC
I get the same results with gimp on my system.
However KolourPaint editor and PhotoQt viewer can not open the files.
Comment 8 Christoph Feck 2018-11-05 22:23:30 UTC
I have only checked the first file (PE363791_S4.JPG from comment #0). This is not a JPEG file, but a JPEG 2000 file. To be able to open it, you need Qt's JPEG 2000 loader, which - depending on the distribution - might be disabled.

I suggest to ask in a forum of your distribution about the status of their JPEG 2000 support in Qt and point them to this bug. Duplicate has more information.

*** This bug has been marked as a duplicate of bug 375641 ***
Comment 9 Christoph Feck 2018-11-05 22:34:19 UTC
Maybe renaming the file to correct extension .jp2 already helps...
Comment 10 Nicola Jelmorini 2018-11-06 20:53:05 UTC
(In reply to Christoph Feck from comment #8)
> I have only checked the first file (PE363791_S4.JPG from comment #0). This
> is not a JPEG file, but a JPEG 2000 file. To be able to open it, you need
> Qt's JPEG 2000 loader, which - depending on the distribution - might be
> disabled.
> 
> I suggest to ask in a forum of your distribution about the status of their
> JPEG 2000 support in Qt and point them to this bug. Duplicate has more
> information.
> 
> *** This bug has been marked as a duplicate of bug 375641 ***


I have checked this out, but on my system I have installed only this library that has to do with jpeg 2000:
libopenjp2-7 - JPEG 2000 image compression/decompression library
Is this the "JPEG 2000 loader" you have specified?
Comment 11 Christoph Feck 2018-11-06 21:23:17 UTC
Please ask in a forum of your distribution for the exact package name of Qt image loaders, and whether they are compiled with libjasper support.