Hi, Offray discovered a strange Zinc bug when reading a JPEG. Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project? This fails on "marker D0 cannot be handled" image := ZnEasy getJpeg: ' http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs... '. World backgroundImage: image layout: #scaled. but this works just fine image := (ImageReadWriter formFromStream: (ZnEasy get: ' http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream). World backgroundImage: image layout: #scaled. Peter
Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project? Any bug found in the standard image regardless of project should be reported on fogbugz, no? but this works just fine⦠If I do: | imageStream | imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream. JPEGReadWriter formFromStream: imageStream. It will give me an error âimage format not recognizedâ. ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ). So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using ( JPEGReadWriter formFromStream: theStream ) ? Best regards, Henrik From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Peter Uhnák Sent: Tuesday, May 24, 2016 6:37 PM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: [Pharo-dev] strange Zinc JPEG bug Hi, Offray discovered a strange Zinc bug when reading a JPEG. Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project? This fails on "marker D0 cannot be handled" image := ZnEasy getJpeg: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...'. World backgroundImage: image layout: #scaled. but this works just fine image := (ImageReadWriter formFromStream: (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream). World backgroundImage: image layout: #scaled. Peter
On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <henrik.nergaard@uia.no> wrote:
Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
Any bug found in the standard image regardless of project should be reported on fogbugz, no?
Ah, good point.
but this works just fineâ¦
If I do:
*| imageStream |*
*imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs... <http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...>') contents readStream.*
*JPEGReadWriter formFromStream: imageStream.*
It will give me an error âimage format not recognizedâ.
ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ).
So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using (
*JPEGReadWriter formFromStream: theStream *) ?
What's the difference? Why do we have two clasees for reading JPEGs? Peter
On 24 May 2016, at 20:11, Peter Uhnák <i.uhnak@gmail.com> wrote:
On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <henrik.nergaard@uia.no> wrote: Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
Any bug found in the standard image regardless of project should be reported on fogbugz, no?
Ah, good point.
but this works just fineâ¦
If I do:
| imageStream |
imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream.
JPEGReadWriter formFromStream: imageStream.
It will give me an error âimage format not recognizedâ.
ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ).
So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using (
JPEGReadWriter formFromStream: theStream ) ?
What's the difference? Why do we have two clasees for reading JPEGs?
Peter
One is implemented in pure Pharo code, the other is plugin based, C code calling a library, and is much faster (and presumable more capable in handling weird cases). I always assumed the fastest one was used automatically, but apparently not. This works: PluginBasedJPEGReadWriter formFromStream: (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') entity readStream. I'll have to look into this. Sven
Here is the fix: === Name: Zinc-HTTP-SvenVanCaekenberghe.450 Author: SvenVanCaekenberghe Time: 25 May 2016, 11:02:23.445172 am UUID: 2785db13-be7c-4ec1-86ce-ca8b4d58bae1 Ancestors: Zinc-HTTP-SvenVanCaekenberghe.449 Re-implement ZnEasy class >> #get[Png|Jpeg|Gif] so that ImageReadWriter decides on the parser to use by checking the magic header, instead of hardcoding a specific subclass. This was necessary because the plugin based JPEG parser was not being used, while it should. Add ZnEasyTests>>#testGetGif and #testGetPng === Name: Zinc-Tests-SvenVanCaekenberghe.237 Author: SvenVanCaekenberghe Time: 25 May 2016, 11:02:43.330855 am UUID: 4a6b5827-daf2-4ccf-b452-cf08e84feb9b Ancestors: Zinc-Tests-SvenVanCaekenberghe.236 Re-implement ZnEasy class >> #get[Png|Jpeg|Gif] so that ImageReadWriter decides on the parser to use by checking the magic header, instead of hardcoding a specific subclass. This was necessary because the plugin based JPEG parser was not being used, while it should. Add ZnEasyTests>>#testGetGif and #testGetPng ===
On 24 May 2016, at 21:11, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 24 May 2016, at 20:11, Peter Uhnák <i.uhnak@gmail.com> wrote:
On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <henrik.nergaard@uia.no> wrote: Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
Any bug found in the standard image regardless of project should be reported on fogbugz, no?
Ah, good point.
but this works just fineâ¦
If I do:
| imageStream |
imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream.
JPEGReadWriter formFromStream: imageStream.
It will give me an error âimage format not recognizedâ.
ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ).
So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using (
JPEGReadWriter formFromStream: theStream ) ?
What's the difference? Why do we have two clasees for reading JPEGs?
Peter
One is implemented in pure Pharo code, the other is plugin based, C code calling a library, and is much faster (and presumable more capable in handling weird cases).
I always assumed the fastest one was used automatically, but apparently not.
This works:
PluginBasedJPEGReadWriter formFromStream: (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') entity readStream.
I'll have to look into this.
Sven
Le 24/5/16 à 19:50, Henrik Nergaard a écrit :
Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
Any bug found in the standard image regardless of project should be reported on fogbugz, no?
Yes I imgaine that there is zinc project there else we should create one.
but this works just fineâ¦
If I do:
/| imageStream |/
//
/imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream./
//
/JPEGReadWriter formFromStream: imageStream./
It will give me an error âimage format not recognizedâ.
ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ).
So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using (
/JPEGReadWriter formFromStream: theStream /) ?
Best regards,
Henrik
*From:*Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] *On Behalf Of *Peter Uhnák *Sent:* Tuesday, May 24, 2016 6:37 PM *To:* Pharo Development List <pharo-dev@lists.pharo.org> *Subject:* [Pharo-dev] strange Zinc JPEG bug
Hi,
Offray discovered a strange Zinc bug when reading a JPEG.
Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
This fails on "marker D0 cannot be handled"
image := ZnEasy getJpeg: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...'.
World backgroundImage: image layout: #scaled.
but this works just fine
image := (ImageReadWriter formFromStream: (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream).
World
backgroundImage: image
layout: #scaled.
Peter
On 25 May 2016, at 08:42, stepharo <stepharo@free.fr> wrote:
Le 24/5/16 à 19:50, Henrik Nergaard a écrit :
Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project? Any bug found in the standard image regardless of project should be reported on fogbugz, no?
Yes I imgaine that there is zinc project there else we should create one.
Of course there is a Zinc category.
but this works just fine⦠If I do:
| imageStream |
imageStream := (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream.
JPEGReadWriter formFromStream: imageStream.
It will give me an error âimage format not recognizedâ.
ImageReadWriter chooses to use PluginBasedJPEGReadWriter instead of JPEGReadWriter (ImageReadWriter >>#readerClassFromStream: ).
So perhaps #getJpeg: should use the PluginBasedJPEGReadWriter or have a fallback on error trying once more by using ( JPEGReadWriter formFromStream: theStream ) ?
Best regards, Henrik
From: Pharo-dev [mailto:pharo-dev-bounces@lists.pharo.org] On Behalf Of Peter Uhnák Sent: Tuesday, May 24, 2016 6:37 PM To: Pharo Development List <pharo-dev@lists.pharo.org> Subject: [Pharo-dev] strange Zinc JPEG bug
Hi,
Offray discovered a strange Zinc bug when reading a JPEG. Not sure where to report zinc bugs⦠fogzbugz? or is it a separate project?
This fails on "marker D0 cannot be handled"
image := ZnEasy getJpeg: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...'. World backgroundImage: image layout: #scaled.
but this works just fine
image := (ImageReadWriter formFromStream: (ZnEasy get: 'http://orig13.deviantart.net/e8d3/f/2013/092/a/3/glados_s_activation_by_firs...') contents readStream). World backgroundImage: image layout: #scaled.
Peter
participants (4)
-
Henrik Nergaard -
Peter Uhnák -
stepharo -
Sven Van Caekenberghe