Transforming JPEG Images into Morphs

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

Transforming JPEG Images into Morphs

bprior
Sven wrote:
It is trivially easy to open a JPEG (or GIF or PNG) and turn it into a Morph: '/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in | (JPEGReadWriter on: in) nextImage asMorph openInWindow ].
I tried this in Pharo 1.4 one-click but got an MNU: 'reset'. It does work, however, in Pharo 3 one-click.
Reply | Threaded
Open this post in threaded view
|

Re: Transforming JPEG Images into Morphs

Sven Van Caekenberghe-2

On 02 Nov 2013, at 17:27, Bruce Prior <[hidden email]> wrote:

> Sven wrote:
> It is trivially easy to open a JPEG (or GIF or PNG) and turn it into a Morph:
> '/Users/Sven/Desktop/test.jpg' asFileReference readStreamDo: [ :in |
>   (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

> I tried this in Pharo 1.4 one-click but got an MNU: 'reset'. It does work, however, in Pharo 3 one-click.

It has been a very long time that I did anything in 1.4 ;-)

The reason is that my code snippet is using the newer FileSystem API, which was probably not ready back then. The older variant not using the newer API is:

FileStream
  fileNamed: '/Users/Sven/Desktop/test.jpg’
  do: [ :in | (JPEGReadWriter on: in) nextImage asMorph openInWindow ].

But I did not test this.

Sven