IsImage vs. wpobjImage

  • What is the difference between an object which "IsImage" is true vs one which IsImage is false, but the type is wpobjImage?

    Reason for asking is that I've run into a case which is causing a TextObject that used to be identified with "IsImage", to become only identified as wpobjImage by using a binary export/import to/from XML. And when this occurs, the image does not appear (you get the X placeholder).

  • Related question:

    Why would in one case, it save the linked image using TWPTempSaveTextObjHelper, and in the other case, save the linked image using TWPOImage?

    Zitat

    {\*\wptools\wpomode0\wpoframe0{\*\wppicname{C:\\Whisper\\WhisperReporter2005\\Release\\Database\\00001\\52e592e3-96eb-4c73-af25-0285f8faa0c6\\IMG_4766.jpg}}{\*\wppicsource{C:\\Whisper\\WhisperReporter2005\\Release\\Database\\00001\\52e592e3-96eb-4c73-af25-0285f8faa0c6\\IMG_4766.jpg}}{\bin397 TWPTempSaveTextObjHelper TPF0TWPTempSaveTextObjHelper WidthTW@HeightTWpWriteRTFModewobAutomaticExtra Type:12;Name:"C:\Whisper\WhisperReporter2005\Release\Database\00001\52e592e3-96eb-4c73-af25-0285f8faa0c6\IMG_4766.jpg";Source:"C:\Whisper\WhisperReporter2005\Release\Database\00001\52e592e3-96eb-4c73-af25-0285f8faa0c6\IMG_4766.jpg";Width:2880;Height:2160;Wrap:0;ObjTag ??? }}

    Zitat

    {\*\wptools\wpomode0\wpoframe0{\*\wppicname{C:\\Whisper\\WhisperReporter2005\\Release\\Database\\00001\\52e592e3-96eb-4c73-af25-0285f8faa0c6\\IMG_4766.jpg}}{\*\wppicsource{C:\\Whisper\\WhisperReporter2005\\Release\\Database\\00001\\52e592e3-96eb-4c73-af25-0285f8faa0c6\\IMG_4766.jpg}}{\bin319
    TWPOImage TPF0 TWPOImage WidthTW@HeightTWpWriteRTFModewobBoth
    StreamNamegC:\Whisper\WhisperReporter2005\Release\Database\00001\52e592e3-96eb-4c73-af25-0285f8faa0c6\IMG_4766.jpgObjTag FileNamegC:\Whisper\WhisperReporter2005\Release\Database\00001\52e592e3-96eb-4c73-af25-0285f8faa0c6\IMG_4766.jpg }}\par


    Any ideas? Must be something I'm doing differently between the way I'm saving and restoring the two images, but not sure what it is yet.

    Thanks for any insight you can pass my way.

    • Offizieller Beitrag

    Hi,

    I would recomend to set the property WriteObjectMode to wobRTF - this avoid saving any embedded wptools objects.

    The TWPTempSaveTextObjHelper is used for a TWPTextObject which does not have an attached TWPObject - I assume when you load from HTML you do not handle the OnRequestHTTPImage event to load AND assign the TWPOImage. (Assign it to TextObj.ObjRef)

  • I think the problem came about, in theory anyway, during the import within my program. At the time of import, the image link is valid since the images were copied into the temp folder which matches the image links. I parse the WPRichText to convert several of my own id's stored in hyperlinks to correspond to the new location where I'll be storing the imported documents. At the same time, I change the image link to correspond to the new location, but that link is invalid at that moment, and save the WPRichText back into a database.

    I think that saving into the database when the image link is invalid is the problem. It seems to have gone away now that I copy the images first so that the image link is still valid before I save the WPRichText.

    Is my theory valid? Just curious as I'm good to go, but this is not the first time the image link being invalid in some of my import/export/cloning routines have haunted me.