[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: [Fwd: Bug#1707: kimgio does not recognize every JPEG image]
From: Harri Porten <porten () tu-harburg ! de>
Date: 1999-08-10 12:59:40
[Download RAW message or body]
Hi !
Should we relax the file magic check for JPEG images ? A 0xffd8 is
certainly good enough for indicating a JPEG file but what about
compatibility ? The README in the jpeg directory says:
> FILE FORMAT WARS
> ================
>
> Some JPEG programs produce files that are not compatible with our library.
> The root of the problem is that the ISO JPEG committee failed to specify a
> concrete file format. Some vendors "filled in the blanks" on their own,
> creating proprietary formats that no one else could read.
> [...]
> Various proprietary file formats incorporating JPEG compression also exist.
> We have little or no sympathy for the existence of these formats. Indeed,
> one of the original reasons for developing this free software was to help
> force convergence on common, open format standards for JPEG files. Don't
> use a proprietary file format!
So the question is
a) a political one (support proprietary formats ?)
b) a technical one (will the library handle these formats ?)
Harri.
Received: from rztsun.rz.tu-harburg.de (rztsun.rz.tu-harburg.de [134.28.200.14])
by hp00.rz.tu-harburg.de (8.8.6 (PHNE_14041)/8.8.6) with ESMTP id RAA16819
for <smhp2803@hp00.rz.tu-harburg.de>; Mon, 9 Aug 1999 17:33:35 +0200 (METDST)
Received: from max.tat.physik.uni-tuebingen.de (max.tat.physik.uni-tuebingen.de [134.2.170.93])
by rztsun.rz.tu-harburg.de (8.9.0/8.8.8) with ESMTP id RAA06069
for <porten@tu-harburg.de>; Mon, 9 Aug 1999 17:33:34 +0200 (MET DST)
Received: by max.tat.physik.uni-tuebingen.de id <749526-14477>; Mon, 9 Aug 1999 17:33:24 +0200
Subject: Bug#1707: kimgio does not recognize every JPEG image
Reply-To: andreas.voegele@gmx.de, 1707@max.tat.physik.uni-tuebingen.de
Resent-From: Andreas Voegele <andreas.voegele@nikocity.de>
Resent-To: kde-bugs-dist@max.tat.physik.uni-tuebingen.de
Resent-CC: Kalle Dalheimer <kalle@kde.org>
Resent-Date: Mon, 09 Aug 1999 15:33:01 GMT
Resent-Message-ID: <handler.1707.B.93421219626351@bugs.kde.org>
Resent-Fake-Sender: coolo@kde.org
X-KDE-PR-Message: report 1707
X-KDE-PR-Package: kdelibs
X-Loop: owner@bugs.kde.org
To: submit@max.tat.physik.uni-tuebingen.de
From: Andreas Voegele <andreas.voegele@nikocity.de>
Date: 09 Aug 1999 17:22:06 +0200
Message-ID: <873dxtvv1d.fsf@columbus.voegele.nikocity.de>
Old-Return-Path: <bugs@max.tat.physik.uni-tuebingen.de>
X-Orcpt: rfc822;kde-bugs-dist@max.tat.physik.uni-tuebingen.de
Resent-Reply-To: kde-bugs-dist@max.tat.physik.uni-tuebingen.de
X-Mailing-List: <kde-bugs-dist@max.tat.physik.uni-tuebingen.de> archive/latest/511
X-Loop: kde-bugs-dist@max.tat.physik.uni-tuebingen.de
Precedence: list
Resent-Sender: kde-bugs-dist-request@max.tat.physik.uni-tuebingen.de
X-Mozilla-Status2: 00000000
Package: kdelibs
Version: 1.1.1
The IO handler defined in kimgio.cpp does only regognize JFIF images,
since it uses the regular expression "^\377\330\377\340..JFIF".
It doesn't recognize pictures taken by Kodak digital kameras, for example,
which contain the bytes "\377\330\377\340..Exif" in the header.
The magic data file on Debian GNU/Linux systems uses only two bytes to
recognize JPEG images:
# JPEG images
# SunOS 5.5.1 had
#
# 0 string \377\330\377\340 JPEG file
# 0 string \377\330\377\356 JPG file
#
# both of which turn into "JPEG image data" here.
#
0 beshort 0xffd8 JPEG image data
>6 string JFIF \b, JFIF standard
# HSI is Handmade Software's proprietary JPEG encoding scheme
0 string hsi1 JPEG image data, HSI proprietary
Therefore, I think, the regular expression "^\377\330\377\340..JFIF"
should be shortened to "^\377\330" in kimgio.cpp:
#ifdef HAVE_LIBJPEG
// JPEG
QImageIO::defineIOHandler( "JPEG", "^\377\330", 0,
kimgio_jpeg_read, kimgio_jpeg_write );
#endif
Or maybe to something a little bit more safe, like
"^\377\330\377...[A-Za-z][A-Za-z][A-Za-z][A-Za-z]".
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic