FLTK logo

STR #419

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

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:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#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 ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.