Sometimes when attempting to load images from .jpg files, some files will not load. The following warning will display. File is not a supported type of bitmapped image (.bmp, .pcx, .tif, .gif, .jpg). If I load the offending file into Windows paint and resave it then it will load. Ideas? Thanks, -Carl CgPixmap class>>imageFromFile: aFileName "Answer a new image loaded from <aFileName>" | file readerClass reader image | (file := CfsFileDescriptor open: aFileName oflag: 0) isCfsError ifTrue: [ (file := CfsFileDescriptor open: CgScreen bitmapPath first, aFileName oflag: 0) isCfsError ifTrue: [ CgServer default warning: 'Could not open the selected file.'. ^nil]]. readerClass := CgImageFileFormat formatMatchingFileHandle: file atOffset: 0 ifNone: [ file close. CgServer default warning: 'File is not a supported type of bitmapped image (.bmp, .pcx, .tif, .gif, .jpg).'. ^nil]. image := (reader := readerClass new) loadFromFileHandle: file atOffset: 0. reader hasErrorOccurred ifTrue: [self error: 'Unable to load bitmap file: ', aFileName]. file close. image isNil ifTrue: [ file close. CgServer default warning: reader currentErrorString. ^nil]. ^image You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Carl,
-- This sounds like a problem I think I reported but is not fixed yet. I removed a line of code from a CgJPEGFileFormat class method #formatMatchesByteStream:. I can't remember if this was a real fix or a circumvention. Lou
On Thursday, June 11, 2015 at 3:13:32 PM UTC-4, Carl Gundel wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Thanks Lou. That does seem to do the trick. The guys at Instantiations should consider your change. :-) -Carl On Friday, June 12, 2015 at 9:22:02 AM UTC-4, Louis LaBrunda wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hey Carl,
-- Glad it worked. I will have to check to see if I officially reported it. Lou On Friday, June 12, 2015 at 4:16:11 PM UTC-4, Carl Gundel wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Carl,
-- Please email me the offending file at the address on this page (http://www.instantiations.com/support/index.html#contact). That will open a support case and I will check out Lou's fix. Donald On Friday, June 12, 2015 at 4:20:22 PM UTC-4, Louis LaBrunda wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Administrator
|
In reply to this post by Louis LaBrunda
On Friday, June 12, 2015 at 6:22:02 AM UTC-7, Louis LaBrunda wrote:
Per this article in Wikepedia (https://en.wikipedia.org/wiki/JPEG_File_Interchange_Format): "For a valid JFIF file, the APP0 marker segment is mandatory right after the SOI marker." The actual JPEG article (https://en.wikipedia.org/wiki/JPEG) says: "The first of these, released in 1992, was JPEG File Interchange Format (or JFIF), followed in recent years by Exchangeable image file format (Exif) and ICC color profiles. Both of these formats use the actual JIF byte layout, consisting of different markers, but in addition employ one of the JIF standard's extension points, namely the application markers: JFIF use APP0, while Exif use APP1." I read all that as saying that you can have an EXIF file which is not JFIF compliant and you can have a JPEG image in a file without the file being JFIF formatted. Even so, it sounds like an unusual file. Where did you get it? -- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hello,
-- Back in 2001, SWT (The Java port of Cg/Cw in VA) had a bug reported on exactly this issue. The result was, and I just confirmed in the source code, to remove the appn segment verification. In their particular case, whatever created the image produced a unknown APPN byte (...opening in paint and resaving fixes that up). However, I see for Exif that readers should be designed to skip over invalid APPN and COM. All this to say...I think we will remove it. --Seth On Friday, June 12, 2015 at 6:50:45 PM UTC-4, Richard Sargent wrote: On Friday, June 12, 2015 at 6:22:02 AM UTC-7, Louis LaBrunda wrote: You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
All, So removing that assumption still seems like the right approach to me. I will put in a case and get it fixed for the next release. Thanks On Saturday, June 13, 2015 at 11:53:08 AM UTC-4, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Opened Case 58094: Relax JPEG reader's assumption that APPN segment immediately follows SOI
-- On Saturday, June 13, 2015 at 3:36:50 PM UTC-4, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Seth,
-- Would it make sense to throw a resumable error? That way the developer could decide to ignore the error and move on or stop. Lou On Saturday, June 13, 2015 at 3:51:55 PM UTC-4, Seth Berman wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Louis,
-- I can certainly see some cases where this would make sense. For example, if you wanted to know the jpeg metadata was not-quite-to-spec. I'm not sure if I would classify it as an error (well it's a spec interpretation error I suppose). But I don't understand on what basis one would want to just stop. I can certainly see wanting to log it and move on. From what I have read and seen...readers should be designed to just ignore it (in terms of the Appn segment being directly after the SOI). It gets picked up later when looping through the segments, and when/if we do see it...it still gets verification rules run against it. Even if we never saw an APPN segment...it doesn't directly have anything to do with our ability to read an otherwise valid jpeg. When we write it back out, it would be written to spec as we put a new APPN segment after the SOI. This was the situation when Carl opened it in Paint and saved it back out. Seems like a separate piece of functionality might be more beneficial to answer the question: Is this JPEG file to spec? -- Seth On Tuesday, June 16, 2015 at 11:59:27 AM UTC-4, Louis LaBrunda wrote:
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Hi Seth,
On Tuesday, June 16, 2015 at 12:48:23 PM UTC-4, Seth Berman wrote:
I like that even better. Nothing to catch and resume, which is most use cases and if one really cares, ask your new question with a simple message. Perfect. Lou
-- You received this message because you are subscribed to the Google Groups "VA Smalltalk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. Visit this group at http://groups.google.com/group/va-smalltalk. For more options, visit https://groups.google.com/d/optout. |
Free forum by Nabble | Edit this page |