Image data corrupt on RTF save after ugprade

  • Hi,

    We recently upgraded to the latest version (6.27) from a fairly old version (6.14) and we are now getting exceptions when attempting to load saved RTF data which contained images.

    Here is how we currently save the data:

    And to load back in we just use Editor.LoadFromString with WriteObjectMode set to wobRTF. I have tried enabling the $DEFINE PNGIMG directive in the WPINC.inc file and re-compiling but that didn't appear to change anything. I have read through the release notes posted on this thread and I can see there has been some changes to the save implementation, however, nothing seems to be jumping out at me. There was a lot of changes between the versions so I may just be missing it.

    Any ideas what I need to do to fix this?

    PNG load error:

    Zitat

    The file being read is not a valid "Portable Network Graphics" image because it contains an invalid header. This file may be corrupted, try obtaining it again.

    JPEG load error:

    Zitat

    JPEG error #11 (apparently means "Sampling factors too large for interleaved scan")

    WMF load error:

    Zitat

    Metafile is not valid

  • I am using Editor.SaveToStream (see code sample), I need to use a TStringStream because the data is serialized to XML.

    Like I say, this used to work perfectly fine. Has anything in particular changed with the way the editor saves images?

  • Using RTFNoBinary did the trick thanks!

    One other issue I have noticed though (not sure if you would prefer I opened another thread) - When I save/reload WMF/EMF images the quality seems to be lost? Is this a known issue?

    I know previously there would be slight quality loss but with the new version WMF are really low. EMF is the same as before.