# HG changeset patch # User matilk # Date 1456153464 -3600 # Node ID a8900d28752bbe374637e87f96156c514c075943 # Parent 76899d7114cd34e76b32c69fb33d3cb5b3e182ab #BUGFIX class: WindowsIconReader changed: #fromWindowsICOStream:alreadyRead: support reading rgba depth32 images. diff -r 76899d7114cd -r a8900d28752b WindowsIconReader.st --- a/WindowsIconReader.st Thu Feb 18 13:47:37 2016 +0100 +++ b/WindowsIconReader.st Mon Feb 22 16:04:24 2016 +0100 @@ -11,6 +11,8 @@ " "{ Package: 'stx:libview2' }" +"{ NameSpace: Smalltalk }" + ImageReader subclass:#WindowsIconReader instanceVariableNames:'compression inDepth' classVariableNames:'' @@ -1046,6 +1048,24 @@ srcIndex := srcIndex + bytesPerRow. dstIndex := dstIndex - bytesPerRow. ]. + + inDepth == 32 ifTrue:[ + srcIndex := 1. + 1 to:height do:[:row | + 1 to:width do:[:row | + |b1 b2 b3 b4| + b1 := tmp at:srcIndex. + b2 := tmp at:srcIndex+1. + b3 := tmp at:srcIndex+2. + b4 := tmp at:srcIndex+3. + tmp at:srcIndex put:b3. + tmp at:srcIndex+2 put:b1. + + srcIndex := srcIndex + 4. + ]. + ]. + ]. + rawData := tmp. nColor > 0 ifTrue:[ @@ -1318,11 +1338,11 @@ !WindowsIconReader class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $' + ^ '$Header$' ! version_CVS - ^ '$Header: /cvs/stx/stx/libview2/WindowsIconReader.st,v 1.68 2014-11-26 12:45:44 cg Exp $' + ^ '$Header$' ! !