#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Wed, 23 Aug 2017 17:26:53 +0200
changeset 8096 42e3303fe2c2
parent 8095 7d4b25655182
child 8097 2a80bbb855bf
#BUGFIX by cg class: Image changed: #greyImageAsTrueColorFormOn:
Image.st
--- a/Image.st	Wed Aug 23 17:26:39 2017 +0200
+++ b/Image.st	Wed Aug 23 17:26:53 2017 +0200
@@ -6488,7 +6488,7 @@
      redShift   "{ Class: SmallInteger }"
      blueShift  "{ Class: SmallInteger }"
      greenShift "{ Class: SmallInteger }"
-     form bestFormat usedDeviceDepth usedDeviceBitsPerPixel imageBits
+     form bestFormat usedDeviceDepth usedDeviceBitsPerPixel
      greyValue  "{ Class: SmallInteger }"
      h          "{ Class: SmallInteger }"
      w          "{ Class: SmallInteger }"
@@ -6499,6 +6499,7 @@
 
     myDepth := self depth.
     myDepth > 16 ifTrue:[
+        "/ for now: deep greyscale images are not supported.
         self error:'unsupported depth' mayProceed:true.
         ^ nil
     ].
@@ -6535,17 +6536,15 @@
         colorValues reverse
     ].
 
+    "/ the temporary helper image is only needed to allow
+    "/ the rowAt:putAll: calls below.
     bestFormat := self bestSupportedImageFormatFor:aDevice.
     usedDeviceDepth := bestFormat at:#depth.
     usedDeviceBitsPerPixel := bestFormat at:#bitsPerPixel.
 
-    "/ the temporary helper image is only needed to allow
-    "/ the rowAt:putAll: calls below.
-
     i := (Image implementorForDepth:usedDeviceBitsPerPixel) new.
     i width:width height:height.
     i createPixelStore.
-    imageBits := i bits.
 
     "/ now, walk over the image and replace
     "/ colorMap indices by color values in the bits array
@@ -6569,7 +6568,7 @@
     form initGC.
 
     form
-        copyBitsFrom:imageBits
+        copyBitsFrom:i bits
         bitsPerPixel:usedDeviceBitsPerPixel
         depth:usedDeviceDepth
         padding:8
@@ -6580,8 +6579,8 @@
     ^ form
 
     "Created: / 20-10-1995 / 22:05:10 / cg"
-    "Modified: / 05-02-2011 / 10:40:13 / cg"
     "Modified (format): / 31-01-2017 / 14:42:05 / stefan"
+    "Modified (format): / 23-08-2017 / 16:35:13 / cg"
 ! !
 
 !Image methodsFor:'converting palette images'!