strange Zinc JPEG bug

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

strange Zinc JPEG bug

Peter Uhnak
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"

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_first9-d605rwi.jpg') contents readStream).
World
backgroundImage: image
layout: #scaled.

Peter
Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

Henrik Nergaard

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_first9-d605rwi.jpg') 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:[hidden email]] On Behalf Of Peter Uhnák
Sent: Tuesday, May 24, 2016 6:37 PM
To: Pharo Development List <[hidden email]>
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"

 

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_first9-d605rwi.jpg') contents readStream).

World

            backgroundImage: image

            layout: #scaled.

 

Peter

Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

Peter Uhnak


On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <[hidden email]> 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_first9-d605rwi.jpg') 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
Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

Sven Van Caekenberghe-2

> On 24 May 2016, at 20:11, Peter Uhnák <[hidden email]> wrote:
>
>
>
> On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <[hidden email]> 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_first9-d605rwi.jpg') 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_first9-d605rwi.jpg') entity readStream.

I'll have to look into this.

Sven


Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

stepharo
In reply to this post by Henrik Nergaard



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_first9-d605rwi.jpg') 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 [[hidden email]] On Behalf Of Peter Uhnák
Sent: Tuesday, May 24, 2016 6:37 PM
To: Pharo Development List [hidden email]
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"

 

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_first9-d605rwi.jpg') contents readStream).

World

            backgroundImage: image

            layout: #scaled.

 

Peter


Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

Sven Van Caekenberghe-2

> On 25 May 2016, at 08:42, stepharo <[hidden email]> 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_first9-d605rwi.jpg') 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:[hidden email]] On Behalf Of Peter Uhnák
>> Sent: Tuesday, May 24, 2016 6:37 PM
>> To: Pharo Development List <[hidden email]>
>> 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_first9-d605rwi.jpg'.
>> 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_first9-d605rwi.jpg') contents readStream).
>> World
>>             backgroundImage: image
>>             layout: #scaled.
>>  
>> Peter
>
>


Reply | Threaded
Open this post in threaded view
|

Re: strange Zinc JPEG bug

Sven Van Caekenberghe-2
In reply to this post by Sven Van Caekenberghe-2
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 <[hidden email]> wrote:
>
>
>> On 24 May 2016, at 20:11, Peter Uhnák <[hidden email]> wrote:
>>
>>
>>
>> On Tue, May 24, 2016 at 7:50 PM, Henrik Nergaard <[hidden email]> 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_first9-d605rwi.jpg') 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_first9-d605rwi.jpg') entity readStream.
>
> I'll have to look into this.
>
> Sven
>