ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

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

ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Offray Vladimir Luna Cárdenas-2
Hi,

Today I was an introduction to Pharo. As usual, I asked the learner to
taste the environment and syntax by running the examples in excellent
Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
When she was adapting the example 6 about converting JPGs to PNGs, we
get the error reported in this mail's subject. I tried running her
example in my machine with her images and with my own and still I got
the same error. What are we missing?

[1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.

Thanks,

Offray



Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Stéphane Ducasse
Thanks for the report I confirm that I can reproduce the problem.
I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg. 
S. 


On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi,

Today I was an introduction to Pharo. As usual, I asked the learner to
taste the environment and syntax by running the examples in excellent
Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
When she was adapting the example 6 about converting JPGs to PNGs, we
get the error reported in this mail's subject. I tried running her
example in my machine with her images and with my own and still I got
the same error. What are we missing?

[1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.

Thanks,

Offray




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

tomo
Offray,

Apparently, readStreamDo: should be binaryReadStreamDo: and
writeStreamDo: should be binaryWriteStreamDo: .
---
tomo

2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:

>
> Thanks for the report I confirm that I can reproduce the problem.
> I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
> S.
>
>
> On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>
> Hi,
>
> Today I was an introduction to Pharo. As usual, I asked the learner to
> taste the environment and syntax by running the examples in excellent
> Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
> When she was adapting the example 6 about converting JPGs to PNGs, we
> get the error reported in this mail's subject. I tried running her
> example in my machine with her images and with my own and still I got
> the same error. What are we missing?
>
> [1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0
>
> We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.
>
> Thanks,
>
> Offray
>
>
>
>
> --------------------------------------------
> Stéphane Ducasse
> http://stephane.ducasse.free.fr / http://www.pharo.org
> 03 59 35 87 52
> Assistant: Aurore Dalle
> FAX 03 59 57 78 50
> TEL 03 59 35 86 16
> S. Ducasse - Inria
> 40, avenue Halley,
> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> Villeneuve d'Ascq 59650
> France
>

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Offray Vladimir Luna Cárdenas-2
Thanks Tomo,

I tried your proposal, but now I get: "Error: marker C2 cannot be
handled" and still the exportation is not working.

Cheers,

Offray

On 4/08/20 2:04 a. m., Tomohiro Oda wrote:

> Offray,
>
> Apparently, readStreamDo: should be binaryReadStreamDo: and
> writeStreamDo: should be binaryWriteStreamDo: .
> ---
> tomo
>
> 2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:
>> Thanks for the report I confirm that I can reproduce the problem.
>> I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
>> S.
>>
>>
>> On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
>>
>> Hi,
>>
>> Today I was an introduction to Pharo. As usual, I asked the learner to
>> taste the environment and syntax by running the examples in excellent
>> Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
>> When she was adapting the example 6 about converting JPGs to PNGs, we
>> get the error reported in this mail's subject. I tried running her
>> example in my machine with her images and with my own and still I got
>> the same error. What are we missing?
>>
>> [1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0
>>
>> We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.
>>
>> Thanks,
>>
>> Offray
>>
>>
>>
>>
>> --------------------------------------------
>> Stéphane Ducasse
>> http://stephane.ducasse.free.fr / http://www.pharo.org
>> 03 59 35 87 52
>> Assistant: Aurore Dalle
>> FAX 03 59 57 78 50
>> TEL 03 59 35 86 16
>> S. Ducasse - Inria
>> 40, avenue Halley,
>> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
>> Villeneuve d'Ascq 59650
>> France
>>

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

tomo
Offray,

I tried it myself and found that the code works on some jpg pics and
does not work on some other pics.
For my case, using PluginBasedJPEGReadWriter instead of JPEGReadWriter
solved the problem.

Best Regards,
---
tomo

2020年8月5日(水) 2:43 Offray Vladimir Luna Cárdenas <[hidden email]>:

>
> Thanks Tomo,
>
> I tried your proposal, but now I get: "Error: marker C2 cannot be
> handled" and still the exportation is not working.
>
> Cheers,
>
> Offray
>
> On 4/08/20 2:04 a. m., Tomohiro Oda wrote:
> > Offray,
> >
> > Apparently, readStreamDo: should be binaryReadStreamDo: and
> > writeStreamDo: should be binaryWriteStreamDo: .
> > ---
> > tomo
> >
> > 2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:
> >> Thanks for the report I confirm that I can reproduce the problem.
> >> I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
> >> S.
> >>
> >>
> >> On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
> >>
> >> Hi,
> >>
> >> Today I was an introduction to Pharo. As usual, I asked the learner to
> >> taste the environment and syntax by running the examples in excellent
> >> Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
> >> When she was adapting the example 6 about converting JPGs to PNGs, we
> >> get the error reported in this mail's subject. I tried running her
> >> example in my machine with her images and with my own and still I got
> >> the same error. What are we missing?
> >>
> >> [1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0
> >>
> >> We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.
> >>
> >> Thanks,
> >>
> >> Offray
> >>
> >>
> >>
> >>
> >> --------------------------------------------
> >> Stéphane Ducasse
> >> http://stephane.ducasse.free.fr / http://www.pharo.org
> >> 03 59 35 87 52
> >> Assistant: Aurore Dalle
> >> FAX 03 59 57 78 50
> >> TEL 03 59 35 86 16
> >> S. Ducasse - Inria
> >> 40, avenue Halley,
> >> Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
> >> Villeneuve d'Ascq 59650
> >> France
> >>
>

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Stéphane Ducasse
offray 

could you add your pictures to the bug entry


S. 

On 5 Aug 2020, at 07:53, Tomohiro Oda <[hidden email]> wrote:

Offray,

I tried it myself and found that the code works on some jpg pics and
does not work on some other pics.
For my case, using PluginBasedJPEGReadWriter instead of JPEGReadWriter
solved the problem.

Best Regards,
---
tomo

2020年8月5日(水) 2:43 Offray Vladimir Luna Cárdenas <[hidden email]>:

Thanks Tomo,

I tried your proposal, but now I get: "Error: marker C2 cannot be
handled" and still the exportation is not working.

Cheers,

Offray

On 4/08/20 2:04 a. m., Tomohiro Oda wrote:
Offray,

Apparently, readStreamDo: should be binaryReadStreamDo: and
writeStreamDo: should be binaryWriteStreamDo: .
---
tomo

2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:
Thanks for the report I confirm that I can reproduce the problem.
I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
S.


On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi,

Today I was an introduction to Pharo. As usual, I asked the learner to
taste the environment and syntax by running the examples in excellent
Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
When she was adapting the example 6 about converting JPGs to PNGs, we
get the error reported in this mail's subject. I tried running her
example in my machine with her images and with my own and still I got
the same error. What are we missing?

[1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.

Thanks,

Offray




--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Offray Vladimir Luna Cárdenas-2

Thanks Stéphane and Tomo,

I have added the working code to the GH issue thread. There is still need of testing images for the non working one?

Offray

On 5/08/20 4:00 a. m., Stéphane Ducasse wrote:
offray 

could you add your pictures to the bug entry


S. 

On 5 Aug 2020, at 07:53, Tomohiro Oda <[hidden email]> wrote:

Offray,

I tried it myself and found that the code works on some jpg pics and
does not work on some other pics.
For my case, using PluginBasedJPEGReadWriter instead of JPEGReadWriter
solved the problem.

Best Regards,
---
tomo

2020年8月5日(水) 2:43 Offray Vladimir Luna Cárdenas <[hidden email]>:

Thanks Tomo,

I tried your proposal, but now I get: "Error: marker C2 cannot be
handled" and still the exportation is not working.

Cheers,

Offray

On 4/08/20 2:04 a. m., Tomohiro Oda wrote:
Offray,

Apparently, readStreamDo: should be binaryReadStreamDo: and
writeStreamDo: should be binaryWriteStreamDo: .
---
tomo

2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:
Thanks for the report I confirm that I can reproduce the problem.
I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
S.


On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi,

Today I was an introduction to Pharo. As usual, I asked the learner to
taste the environment and syntax by running the examples in excellent
Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
When she was adapting the example 6 about converting JPGs to PNGs, we
get the error reported in this mail's subject. I tried running her
example in my machine with her images and with my own and still I got
the same error. What are we missing?

[1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.

Thanks,

Offray




--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France

Reply | Threaded
Open this post in threaded view
|

Re: ZnInvalidUTF8: Illegal leading byte for utf-8 encoding while running Elegant Code image conversion example

Stéphane Ducasse
this would be nice for archival in the bug entry.

S

On 5 Aug 2020, at 18:34, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Thanks Stéphane and Tomo,

I have added the working code to the GH issue thread. There is still need of testing images for the non working one?

Offray

On 5/08/20 4:00 a. m., Stéphane Ducasse wrote:
offray 

could you add your pictures to the bug entry


S. 

On 5 Aug 2020, at 07:53, Tomohiro Oda <[hidden email]> wrote:

Offray,

I tried it myself and found that the code works on some jpg pics and
does not work on some other pics.
For my case, using PluginBasedJPEGReadWriter instead of JPEGReadWriter
solved the problem.

Best Regards,
---
tomo

2020年8月5日(水) 2:43 Offray Vladimir Luna Cárdenas <[hidden email]>:

Thanks Tomo,

I tried your proposal, but now I get: "Error: marker C2 cannot be
handled" and still the exportation is not working.

Cheers,

Offray

On 4/08/20 2:04 a. m., Tomohiro Oda wrote:
Offray,

Apparently, readStreamDo: should be binaryReadStreamDo: and
writeStreamDo: should be binaryWriteStreamDo: .
---
tomo

2020年8月4日(火) 15:42 Stéphane Ducasse <[hidden email]>:
Thanks for the report I confirm that I can reproduce the problem.
I do not know yet the answer. Now I think strange that we use a characterStream for reading jpeg.
S.


On 3 Aug 2020, at 20:41, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:

Hi,

Today I was an introduction to Pharo. As usual, I asked the learner to
taste the environment and syntax by running the examples in excellent
Sven's Elegant Code[1] (BTW, can I translate snips of  it to Spanish?).
When she was adapting the example 6 about converting JPGs to PNGs, we
get the error reported in this mail's subject. I tried running her
example in my machine with her images and with my own and still I got
the same error. What are we missing?

[1] https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0

We are using Pharo 8.x on Manjaro Gnu/Linux 64 bits.

Thanks,

Offray




--------------------------------------------
Stéphane Ducasse
http://stephane.ducasse.free.fr / http://www.pharo.org
03 59 35 87 52
Assistant: Aurore Dalle
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley,
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France




--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France


--------------------------------------------
Stéphane Ducasse
03 59 35 87 52
Assistant: Aurore Dalle 
FAX 03 59 57 78 50
TEL 03 59 35 86 16
S. Ducasse - Inria
40, avenue Halley, 
Parc Scientifique de la Haute Borne, Bât.A, Park Plaza
Villeneuve d'Ascq 59650
France