| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #419
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 1 - Request for Enhancement, e.g. asking for a feature |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Image Support |
Summary: | Fl_XXX_Image classes need a status function |
Version: | 1.3-feature |
Created By: | anonymous |
Assigned To: | mike |
Fix Version: | 1.3.4 (SVN: v10732) |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | anonymous 11:31 Jun 10, 2004 |
| The Fl_XXX_Image classes, such as Fl_PNG_Image, Fl_JPEG_Image, etc. take a filename as the required argument to the constructor.
There is no mechanism to tell if an image file loaded correctly, and probably more importantly, to find why a file failed to load.
Possible failure reasons include at least: file does not exist file not readable file format incorrect premature end-of-file
(FYI: I have wasted two full days attempting to load a BMP, PNG, or JPEG image using these classes and it failed on every attempt. I finally wrote my own BMP file reader.)
Mark
| |
|
#2 | mike 09:48 Jun 12, 2004 |
| IIRC, the width, height, and depth [w(), h(), and d()] will all be 0 if the image cannot be loaded.
Unfortunately, C++ doesn't offer much to handle this outside of exceptions, and those aren't (yet) portable.
We can't add extra fields to the image classes without breaking binary compatibility, however it should be possible to add an inline method which checks for invalid image dimensions and reports whether there is an error in the image or not.
Is a separate method important to you, or is checking for w() and h() == 0 sufficient? | |
|
#3 | mike 08:12 Jul 27, 2004 |
| This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR. | |
|
#4 | AlbrechtS 04:29 Sep 01, 2016 |
| Fixed in Subversion repository.
See STR #2873.
New method Fl_Image::fail(). | |
[ Return to Bugs & Features ]
|
| |