bugGNUstep - Bugs: bug #29633, Problem with images on RTFD files

Group
 
 

bug #29633: Problem with images on RTFD files

Submitter:  Germán Arias <espectador>
Submitted:  Wed 21 Apr 2010 06:30:57 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 02 May 2010 09:49:58 AM UTC, comment #9: 

Thank you for spotting this problem. With the last change I tried to remove some of these extra spaces, but accidentally added another one without noticing. This should be fixed now.

Fred Kiefer <FredKiefer>
Group Member
Sun 02 May 2010 02:17:52 AM UTC, comment #8: 

I regret to say that your RTFProducer changes have introduced a new bug. RTFProducer now writes out a space character after every \'xx escape sequence. I have attached a test case. Open the file with Ink, then save it with the Save To... command and open the new file again. Notice that now there is a space after every umlaut character.

(file #20385)

Wolfgang Lux <wlux>
Sat 01 May 2010 11:08:32 PM UTC, comment #7: 

To me now work fine.

Germán Arias <espectador>
Sat 01 May 2010 04:32:32 PM UTC, comment #6: 

Committed my RTFProducer changes to resolve this last remaining issue. Could everybody please check that the generated RTF is at least as usable as before?

Fred Kiefer <FredKiefer>
Group Member
Sat 01 May 2010 12:40:09 PM UTC, comment #5: 


> GNUstep currently outputs the NSAttachmentCharacter directly
> as the string for the attachment (\u-4).


Well that is not the whole story. RTFProducer's _runStringForString:attributes: also inserts a space character immediately after the inner {\NeXTGraphic ...} group. It is this space character that would appear before the image.

Wolfgang Lux <wlux>
Sat 01 May 2010 12:12:25 PM UTC, comment #4: 

Thank you Wolfgang, your fix resolved the problem for me.

GNUstep currently outputs the NSAttachmentCharacter directly as the string for the attachment (\u-4). Maybe we also should use 0xAC instead. I will go ahead with some tests on the Mac.

Fred Kiefer <FredKiefer>
Group Member
Sat 01 May 2010 08:31:37 AM UTC, comment #3: 

Fred, you were not completely wrong :-)

According to Apple's documentation the string argument of the \NeXTGraphic is always the single character 0xAC. However, a few experiments on OS X show that the Apple's RTF reader apparently seems to ignore the string. Therefore I have just committed a fix that changes GNUstep's RTF parser to do the same.

Wolfgang Lux <wlux>
Fri 30 Apr 2010 06:45:01 AM UTC, comment #2: 

I investigated further and it turns out that I was completely wrong with my last post. The extra space character is introduced by the writer not the reader. What the reader does is put this space in front of the image, it got inserted by the writer after the image. What we have here are multiple issues and I have a partial fix for the writing problem. What I need to do with that is check that I did not break RTF creation for all other cases.
Next I have to find out if that reversion issues in the loader could affect other cases as well. If so, we need to fix that as well.

Fred Kiefer <FredKiefer>
Group Member
Fri 23 Apr 2010 08:15:18 AM UTC, comment #1: 

I tried this myself and yes, there is an extra space added each time you load the saved file. When I save the file the first time there isn't a space in the generated RTF document, but after loading the file the space is there.
From this I expect the problem to be in the RTF loading code. (Or somewhere in our layout code, but this isn't that realistic. Also I prefer not to look there :-)

At first glance I could not find anything that looks like a string with a space being added in that code. This problem may have to wait till after the release.

Fred Kiefer <FredKiefer>
Group Member
Wed 21 Apr 2010 06:30:57 PM UTC, original submission:  

You can try this on Ink. Make a new document and add an image and some text. Save the document, and open this. You can see an space before the image. Now add more text in the document and save it. Close the document, and open this again. Now you can see two spaces before the image. Each time you modify the document and save this. When you open this again there is a new space added before the image.

Germán Arias <espectador>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #20385:  umlaut-test.rtf added by wlux (318B - text/rtf)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wlux (Posted a comment)
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by espectador (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-05-02 FredKiefer StatusReady For Test Fixed
        Open/ClosedIn Test Closed
    2010-05-02 wlux Attached File- Added umlaut-test.rtf, #20385
    2010-05-01 FredKiefer StatusConfirmed Ready For Test
        Assigned toFredKiefer None
        Open/ClosedOpen In Test
    2010-04-23 FredKiefer StatusNone Confirmed
        Assigned toNone FredKiefer

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code