On Feb 27, 2009, at 11:48 AM, Frank Bitterlich wrote:
Am 26.02.2009 um 22:59 schrieb Charles Yeomans:
On Feb 26, 2009, at 4:40 PM, Frank Bitterlich wrote:
Hi,
I'm experiencing stuff which made me rub my eyes in disbelief... A
file I created with FolderItem.SaveAsPicture() mysteriously
experienced a "cut" to the filename - the extension read ".pn"
instead of ".png". Further experimenting appears to show that the
filename is being cut off after the 32nd character every time. And
yes, this is on Mac OS X, not Mac OS 9 ;)
...
What version of REALbasic? With Rb 2008r51 and Mac OS 10.5.6, this
operation does the right thing.
Not for me (exact same versions - 2008_5.1 and 10.5.6). This code....
dim fi as FolderItem
dim pic as Picture
dim msg as string
dim errNo as integer
fi =
SpecialFolder
.Desktop.Child("aaaaabbbbbcccccdddddeeeeefffff1234567890.png")
pic = NewPicture(50, 50, 32)
pic.Graphics.ForeColor = &cffffff
pic.Graphics.FillRect 0, 0, 50, 50
pic.Graphics.ForeColor = &cff0000
pic.Graphics.DrawOval 0, 0, 50, 50
fi.SaveAsPicture(pic, fi.SaveAsPNG)
errNo = fi.LastErrorCode
msg = "The folderItem has the name """ + fi.Name
msg = msg + """ and is reporting the file as "
if not fi.Exists then
msg = msg + "NOT existing. "
else
msg = msg + "existing. "
end if
msg = msg + "The LastErrorCode is " + str(errNo)
MsgBox msg
... demonstrates the problem. The resulting file name is cut off
after the "1". LastError is 101. And .exists is false.
I can reproduce this. But if I replace
fi.SaveAsPicture(pic, fi.SaveAsPNG)
by
fi.SaveAsPicture(pic)
then the picture is saved as a .png file, the file name is correct,
and LastErrorCode = 0. This suggests to me that there is some code
duplication under the hood...
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|