[ptx] .jpe suffix patch fix
Stanislav Brabec
utx at penguin.cz
Sun Jun 12 22:11:19 BST 2005
Hallo.
There is an updated JPE patch. It fixes typo in array indexes in
jpeg.cxx and is updated for actual CVS version.
I would be very glad to get this patch included. As Hal V Engel wrote,
renaming JPE files to JPG is not a good solution - on some systems are
JPE files associated with color management aware applications and JPG
files with plain image viewer.
Missing embedded profile in nona result can be easily worked around by
third party applications.
Thanks.
Note that the patch changes one translatable string in MainFrame.cpp.
Index: src/Panorama/PanoramaMemento.cpp
===================================================================
RCS file: /cvsroot/hugin/hugin/src/Panorama/PanoramaMemento.cpp,v
retrieving revision 1.57
diff -u -r1.57 PanoramaMemento.cpp
--- src/Panorama/PanoramaMemento.cpp 28 May 2005 16:42:11 -0000 1.57
+++ src/Panorama/PanoramaMemento.cpp 12 Jun 2005 20:36:11 -0000
@@ -230,7 +230,7 @@
}
setImageSize(vigra::Size2D(width, height));
- if (ext != "JPG" && ext != "JPEG") {
+ if (ext != "JPG" && ext != "JPEG" && ext != "JPE") {
return false;
}
Index: src/foreign/vigra_impex/jpeg.cxx
===================================================================
RCS file: /cvsroot/hugin/hugin/src/foreign/vigra_impex/jpeg.cxx,v
retrieving revision 1.3
diff -u -r1.3 jpeg.cxx
--- src/foreign/vigra_impex/jpeg.cxx 1 Nov 2004 17:20:13 -0000 1.3
+++ src/foreign/vigra_impex/jpeg.cxx 12 Jun 2005 20:36:12 -0000
@@ -61,9 +61,10 @@
desc.magicStrings[0][2] = '\377';
// init file extensions
- desc.fileExtensions.resize(2);
+ desc.fileExtensions.resize(3);
desc.fileExtensions[0] = "jpg";
desc.fileExtensions[1] = "jpeg";
+ desc.fileExtensions[2] = "jpe";
return desc;
}
Index: src/hugin/LensPanel.cpp
===================================================================
RCS file: /cvsroot/hugin/hugin/src/hugin/LensPanel.cpp,v
retrieving revision 1.82
diff -u -r1.82 LensPanel.cpp
--- src/hugin/LensPanel.cpp 18 May 2005 12:50:21 -0000 1.82
+++ src/hugin/LensPanel.cpp 12 Jun 2005 20:36:12 -0000
@@ -662,7 +662,8 @@
// check file extension
wxFileName file(wxString(pano.getImage(imgNr).getFilename().c_str(), *wxConvCurrent));
if (file.GetExt().CmpNoCase(wxT("jpg")) == 0 ||
- file.GetExt().CmpNoCase(wxT("jpeg")) == 0 )
+ file.GetExt().CmpNoCase(wxT("jpeg")) == 0 ||
+ file.GetExt().CmpNoCase(wxT("jpe")) == 0 )
{
double c=0;
initLensFromFile(pano.getImage(imgNr).getFilename().c_str(), c, lens);
Index: src/hugin/MainFrame.cpp
===================================================================
RCS file: /cvsroot/hugin/hugin/src/hugin/MainFrame.cpp,v
retrieving revision 1.156
diff -u -r1.156 MainFrame.cpp
--- src/hugin/MainFrame.cpp 9 Jun 2005 09:55:05 -0000 1.156
+++ src/hugin/MainFrame.cpp 12 Jun 2005 20:36:12 -0000
@@ -92,6 +92,8 @@
wxFileName file(filenames[0]);
if (file.GetExt().CmpNoCase(wxT("jpg")) == 0 ||
+ file.GetExt().CmpNoCase(wxT("jpeg")) == 0 ||
+ file.GetExt().CmpNoCase(wxT("jpe")) == 0 ||
file.GetExt().CmpNoCase(wxT("tif")) == 0 ||
file.GetExt().CmpNoCase(wxT("tiff")) == 0 ||
file.GetExt().CmpNoCase(wxT("png")) == 0 ||
@@ -637,7 +639,7 @@
// get the global config object
wxConfigBase* config = wxConfigBase::Get();
- wxString wildcard (_("All Image files|*.jpg;*.JPG;*.tif;*.TIF;*.tiff;*.TIFF;*.png;*.PNG;*.bmp;*.BMP;*.gif;*.GIF;*.pnm;*.PNM;*.sun;*.viff|JPEG files (*.jpg)|*.jpg;*.JPG|All files (*.*)|*.*"));
+ wxString wildcard (_("All Image files|*.jpg;*.JPG;*.JPG;*.jpeg;*.jpe;*.JPE;*.tif;*.TIF;*.tiff;*.TIFF;*.png;*.PNG;*.bmp;*.BMP;*.gif;*.GIF;*.pnm;*.PNM;*.sun;*.viff|JPEG files|*.jpg;*.JPG;*.jpeg;*.JPEG;*.jpe|All files (*.*)|*.*"));
wxFileDialog dlg(this,_("Add images"),
config->Read(wxT("actualPath"),wxT("")), wxT(""),
wildcard, wxOPEN|wxMULTIPLE , wxDefaultPosition);
Index: src/tools/automatch.cpp
===================================================================
RCS file: /cvsroot/hugin/hugin/src/tools/automatch.cpp,v
retrieving revision 1.9
diff -u -r1.9 automatch.cpp
--- src/tools/automatch.cpp 27 Oct 2004 18:12:56 -0000 1.9
+++ src/tools/automatch.cpp 12 Jun 2005 20:36:13 -0000
@@ -954,7 +954,9 @@
}
std::string ext = filename.substr( idx+1 );
- if (utils::tolower(ext) == "jpg") {
+ if (utils::tolower(ext) == "jpg" ||
+ utils::tolower(ext) == "jpeg" ||
+ utils::tolower(ext) == "jpe") {
// try to read exif data from jpeg files.
lens.readEXIF(filename);
}
________________________________________________________________________
Stanislav Brabec
http://www.penguin.cz/~utx
More information about the ptX
mailing list