0

The text of the image appears to be unmodified. A simple test so you can see what I see is to get the Mac Classic question icon from the image library and then select it and:

set the text of the selObj to the text of the selObj

You should end up with what appears to be a blank image yet the following put's true:

put the text of the selObj into tText
set the text of the selObj to tText
-- image is now blank
put tText is the text of the selObj
-- true

Any ideas?

Monte Goulding
  • 2,380
  • 1
  • 21
  • 25

2 Answers2

2

The image in question is encoded in 'rle' format which was the original format images were stored in before support for png, gif and jpeg were added. Unfortunately at the moment the text property for such images cannot be round-tripped.

To work around this, you can use the export command to export the image data as PNG / GIF and use that instead.

runrevmark
  • 311
  • 1
  • 2
1

Another way (besides converting to png or other formats) is to not use the text, but instead the imagedata. Note that you need to set the width and height of each handled image to the same values, because imagedata depends on what is shown on the screen, not on what is actually the "true" image stored.

For example:

set the width of image 2 to the width of image 1
set the height of image 2 to the height of image 1
set the imagedata of image 2 to the imagedata of image 1

An image filled with data this way will not behave weirdly in regards to it's text. So you can use this to convert misbehaving images:

set the width of image 1 to the formattedwidth of image 1
set the height of image 1 to the formattedheight of image 1
set the imagedata of image 1 to the imagedata of image 1

As a final note, this sounds like an undesired behaviour to me, did you file a bug?

BvG
  • 425
  • 3
  • 3
  • Thanks BvG. No I haven't filed a bug yet. I'd probably be happy with documenting rle as deprecated, you can not set the text to rle data and make png the default in the runtime engines too. I ran into rle being the default in the iOS engine the other day when I hacked a quick screenshot to test a new external... – Monte Goulding Mar 20 '13 at 19:14