realbasic-nug
[Top] [All Lists]

Re: FolderItem.SaveAsPicture() limited to 32-character filenames?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: FolderItem.SaveAsPicture() limited to 32-character filenames?
From: Charles Yeomans <charles@declareSub.com>
Date: Fri, 27 Feb 2009 12:08:00 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <EA706BB7-84F8-4A1F-85A1-07456636D8E7@gsco.de>
References: <7DE07580-559B-4FE4-B264-37208490E1A6@gsco.de> <2921880F-2507-4458-AB81-09D14D9EB509@declareSub.com> <EA706BB7-84F8-4A1F-85A1-07456636D8E7@gsco.de>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com

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>


<Prev in Thread] Current Thread [Next in Thread>