[Seaside] Smalltalk String and Character question
Avi Bryant
avi.bryant at gmail.com
Sun Mar 20 13:38:38 CET 2005
On Sun, 20 Mar 2005 00:18:50 +0300, Dmitry Dorofeev
<dima-sender-3c337a at yasp.com> wrote:
> Hi all,
>
> just writting WAImage component for Seaside. Now at stage where i need
> to detect image type.
> For jpeg i have the following:
>
> WAImage >> detectImageType: image
> (image beginsWith: (String with: 16rFF asCharacter), (String with:
> 16rD8 asCharacter)) ifTrue: [^ 'jpg'].
>
> Looks quite long comparing to Perl, i know there should be a shorter
> solution :-)
JPEGReadWriter understandsImageFormat: image readStream
;)
Avi
More information about the Seaside
mailing list