ggolggoli / delaboratory

Automatically exported from code.google.com/p/delaboratory
GNU General Public License v3.0
0 stars 0 forks source link

Some TIFF Images don't Load #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to Load a tiff file
2.
3.

What is the expected output? What do you see instead?
I am getting the the following errors:

---------------------------
wxWidgets Debug Alert
---------------------------
./src/common/image.cpp(1634): assert "IsOk()" failed in GetWidth(): invalid 
image
Do you want to stop the program?
You can also choose [Cancel] to suppress further warnings.
---------------------------
Yes   No   Cancel   

And then:

11:54:12 AM: This is not a JPEG file.
11:54:12 AM: Failed to load image from file "I:\Images\2011\Canadian 
Rockies\_S112121.TIF".

Please use labels and text to provide additional information.

Original issue reported on code.google.com by parth...@gmail.com on 23 Jul 2011 at 3:57

GoogleCodeExporter commented 8 years ago
Should have mentioned Jacek, that I downloaded the svn version today. 

Original comment by parth...@gmail.com on 23 Jul 2011 at 3:59

GoogleCodeExporter commented 8 years ago
I think this is because uppercase name, I search for "tif" or "tiff", not "TIF" 
:)
However the dialog window also allows to choose only "tif"/"tiff", is it works 
different on Windows?

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 10:11

GoogleCodeExporter commented 8 years ago
Confirmed. You are right. Cannot open a file with extension TIF. You
need to extend the choices or convert to lowercase before opening?

also, the dialog window does not allow a separate choice for tif/tiff.
The choice is JPEG/TIFF files (*.jpg;*.jpeg;*.tiff;*.tif) only.

Original comment by parth...@gmail.com on 24 Jul 2011 at 11:14

GoogleCodeExporter commented 8 years ago
In main_frame.cc, changing line 172 to:
    wxString type = _T("JPEG/TIFF files (*.jpg;*.jpeg;*.tiff;*.tif;*.TIF;*.TIFF)|*.jpg;*.jpeg;*.tiff;*.tif;*.TIF;*.TIFF");
and line 180 to 
    wxString fileName = openFileDialog.GetPath().Upper();

and in file source_image.cc changing line 33 to
    size_t pos = fileName.rfind("TIF");

seems to fix this issue?

Original comment by parth...@gmail.com on 24 Jul 2011 at 3:03

GoogleCodeExporter commented 8 years ago
The first part is OK however I don't think changing fileName to Upper is 
correct - on Unix case of filename matters :)

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 4:34

GoogleCodeExporter commented 8 years ago
Maybe I should just add "open source JPG" and "open source TIFF" into menu 
instead "open source image" to avoid all image detection problems?

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 4:35

GoogleCodeExporter commented 8 years ago
I thought that changing the filename to uppercase after reading it
would work for unix/linux as well. Of course, I implemented the change
on my Windows 7 machine only, true. :)

Adding open source etc. sounds good to me.

Original comment by parth...@gmail.com on 24 Jul 2011 at 4:48

GoogleCodeExporter commented 8 years ago
openFileDialogs just returns the filename you selected in GUI, it is read later 
- by the libtiff library, so the name must be correct

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 4:51

GoogleCodeExporter commented 8 years ago
OK I need to fix it anyway because you can run delabotory with filename as 
argument so I need to detect the format

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 4:55

GoogleCodeExporter commented 8 years ago
My solution currently lets me do that on my computer.

Original comment by parth...@gmail.com on 24 Jul 2011 at 5:22

GoogleCodeExporter commented 8 years ago
Yes, but only on Windows :)

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 6:47

GoogleCodeExporter commented 8 years ago
Can you detect the file format from the input file rather than rely on
the extension? This might solve the problem on all OSes?

Original comment by parth...@gmail.com on 24 Jul 2011 at 7:07

GoogleCodeExporter commented 8 years ago
Too much work :) Please check revision 222 of SVN, is it works correctly?

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 7:28

GoogleCodeExporter commented 8 years ago
My svn version says 223. :)

Yes, you solved it. Please keep in mind that I updated as opposed to
blowing away the directory and re-downloading it.

BTW, I got feedback that Send to Gimp needs to work. I will open
another issue with that.

Also, feedback from me, I wonder why I can't have another curve in RGB
which is a "value" curve. And, I think the software is coming along
great. Once you allow duplicate layer and layer mask like in Gimp, you
are getting towards replacing Gimp. :)

Original comment by parth...@gmail.com on 24 Jul 2011 at 8:53

GoogleCodeExporter commented 8 years ago
I am closing it now as solved.

Original comment by jacekpop...@gmail.com on 24 Jul 2011 at 9:13