[Seaside] Smalltalk String and Character question

Wolfgang Eder edw at generalmagic.at
Sat Mar 19 23:01:13 CET 2005


Dmitry Dorofeev 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'].

(image beginsWith: (String with: 16rFF asCharacter with: 16rD8
  asCharacter)) ifTrue: [^ 'jpg'].

this should also work.
cheers
wolfgang


> 
> Looks quite long comparing to Perl, i know there should be a shorter 
> solution :-)
> Please help a newbie.
> 
> Thanks,
> 
> -Dmitry.
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
> 





More information about the Seaside mailing list