Etoys: Graphics-kfr.10.mcz

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

Etoys: Graphics-kfr.10.mcz

commits-2
Karl Ramberg uploaded a new version of Graphics to project Etoys:
http://source.squeak.org/etoys/Graphics-kfr.10.mcz

==================== Summary ====================

Name: Graphics-kfr.10
Author: kfr
Time: 9 March 2012, 11:17:14 am
UUID: e83f2b5f-32e7-4572-90c0-388f9b1ffb64
Ancestors: Graphics-kfr.9

Bug fixes for animated gif

=============== Diff against Graphics-kfr.9 ===============

Item was added:
+ ----- Method: AnimatedGIFReadWriter>>understandsImageFormat (in category 'accessing') -----
+ understandsImageFormat
+
+ ^('abc' collect: [:x | stream next asCharacter]) = 'GIF'!

Item was changed:
  ----- Method: Form class>>openImageInWindow: (in category 'file list services') -----
  openImageInWindow: fullName
  "Handle five file formats: GIF, JPG, PNG, Form storeOn: (run coded), and BMP.
  Fail if file format is not recognized.
  Does nothing if called with nil filename."
 
  | image myStream sketch |
  fullName ifNil: [^ self].  
  myStream _ (FileStream readOnlyFileNamed: fullName) binary.
  image _ self fromBinaryStream: myStream.
  myStream close.
 
  Smalltalk isMorphic ifTrue:[
+
  Project current resourceManager
  addResource: image
  url: (FileDirectory urlForFileNamed: fullName) asString.
  ].
 
  Smalltalk isMorphic
  ifTrue: [
+                (image isKindOf: Array)
+ ifTrue:[sketch := (AnimatedImageMorph new fromArray: image) openInWorld]
+ ifFalse:[sketch := (World drawingClass withForm: image) openInWorld].
- sketch _ (World drawingClass withForm: image) openInWorld.
  sketch setNamePropertyTo: (FileDirectory baseNameFor: (FileDirectory localNameFor: myStream fullName)).
  sketch setProperty: #originalEncoding toValue: (FileDirectory extensionFor: myStream fullName)]
  ifFalse: [FormView open: image named: fullName]!

Item was removed:
- ----- Method: GIFReadWriter>>understandsImageFormat (in category 'accessing') -----
- understandsImageFormat
- ^('abc' collect: [:x | stream next asCharacter]) = 'GIF'!

Item was changed:
  ----- Method: ImageReadWriter class>>formFromStream: (in category 'image reading/writing') -----
  formFromStream: aBinaryStream
  "Answer a ColorForm stored on the given stream.  closes the stream"
  | reader readerClass form  |
 
+ readerClass := self withAllSubclasses
- readerClass _ self withAllSubclasses
  detect: [:subclass | subclass understandsImageFormat: aBinaryStream]
  ifNone: [
  aBinaryStream close.
  ^self error: 'image format not recognized'].
+ reader := readerClass new on: aBinaryStream reset.
- reader _ readerClass new on: aBinaryStream reset.
  Cursor read showWhile: [
+ (reader isKindOf: AnimatedGIFReadWriter)
+ ifTrue:[form := {reader allImages. reader delays}]
+ ifFalse:[form := reader nextImage].
- form _ reader nextImage.
  reader close].
  ^ form
  !

Item was removed:
- ----- Method: InfiniteForm>>addFillStyleMenuItems:hand:from: (in category 'menu') -----
- addFillStyleMenuItems: aMenu hand: aHand from: aMorph
- "Add the items for changing the current fill style of the receiver"
-
- "prevents a walkback when control menu is built for morph with me as color"!

_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev