STAR TREK 2d20
Page 1 of 3 123 Last
  1. #1

    Exporting nodes with image blocks... exports images?

    So, this is probably a very specific problem and I might be searching in the wrong place but... here is the issues.

    When you export with the extension Author it does a little bit of pre-export work to create an export node so that it is exported along with everything else FG does by default.

    Code:
    ExportManager.registerExportNode({ name = "_refmanualindex", label = "Reference Manual", export="reference.refmanualindex", sLibraryEntry="reference_manual"});
    The _refmanualindex is created from Story nodes in a ref-manual format. In that creation process I look for "individually placed" image links and create a inline image node that the ref-manuals can use properly to display them.

    I've noted that for every single image block a extra copy of the image file (DungeonMapTest1.jpg in this case) is placed into the exported .mod file. Example:

    <chapters>...<subchapters>...<refpages>...<blocks> ..<id-00002>:
    Code:
    <id-00004>
      <align type="string">center</align>
      <blocktype type="string">image</blocktype>
      <caption type="string">DungeonMapTest1 (2500x3300)</caption>
      <image type="image">
        <bitmap>images/DungeonMapTest1.jpg</bitmap>
      </image>
      <imagelink type="windowreference">
        <class>imagewindow</class>
        <recordname>image.id-00002</recordname>
      </imagelink>
      <size type="string">378,500</size>
    </id-00004>

    No where does my custom code add in those images "files/image.id-*" into the Export node list.

    Is this part of the default behavior of FG with image blocks? I've searched through my code to doubly to make sure I do not add these images to the export list anywhere else...

    My code, simply inserts this ref-manual document node "_refmanualindex" as "reference.refmanualindex" so that when exported and loaded as module users have a link called "Reference Manual" that will load the manual.

    I don't think anyone else does this so it could just be what I'm doing was never intended and has some unintended consequences.

    The full source of the work can be found in my Author project post.

    I think I've exhausted any possible culprits that I could find and wondering if someone else has a theory.
    Last edited by celestian; October 1st, 2018 at 20:59.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  2. #2
    Mortar's Avatar
    Join Date
    May 2014
    Location
    New Brunswick, Canada
    Posts
    1,127
    Blog Entries
    18
    Ikael's SWEL is unable to export images within the refmanual either. I believe if IIRC that he said that it can't currently be done through FG.
    Ultimate License Holder

  3. #3
    Quote Originally Posted by Mortar View Post
    Ikael's SWEL is unable to export images within the refmanual either. I believe if IIRC that he said that it can't currently be done through FG.
    I'm not actually trying to export the images. Just the ref-manual index/nodes. That part works. The other part of /export that I do not manage seems to be adding in a extra image for each one of the images referenced in the image blocks.

    I use the export mechanisms in place so users can export whatever they want as normal. This just adds the extra ref-manual nodes. I suspect FG internals is automatically adding duplicates of them because of the image blocks in the ref manual.
    Last edited by celestian; October 1st, 2018 at 22:46.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  4. #4

    Join Date
    Apr 2008
    Location
    Virginia Beach
    Posts
    3,096
    Well you cannot edit them in so it has to work somehow. (Putting an image in line to xml is not something notepad++ can do or at least I don’t know how to do it). The way I read the pair was that it was inserting two copies

  5. #5
    Quote Originally Posted by Bidmaron View Post
    Well you cannot edit them in so it has to work somehow. (Putting an image in line to xml is not something notepad++ can do or at least I don’t know how to do it). The way I read the pair was that it was inserting two copies
    I'm not sure I understand what you're saying. Perhaps this is more clear.

    I don't actually mess with image records or files. I just read the Story entry, if there is a link to a image there that meets a certain criteria I then make a similar link to that image record in the ref-manual node. So if the story refers to image-id.00001 in a link then I simply replace the entry for a link of a story to a image block referencing image-id.00001.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  6. #6
    Mortar's Avatar
    Join Date
    May 2014
    Location
    New Brunswick, Canada
    Posts
    1,127
    Blog Entries
    18
    Quote Originally Posted by celestian View Post
    I'm not actually trying to export the images. Just the ref-manual index/nodes. That part works. The other part of /export that I do not manage seems to be adding in a extra image for each one of the images referenced in the image blocks.

    I use the export mechanisms in place so users can export whatever they want as normal. This just adds the extra ref-manual nodes. I suspect FG internals is automatically adding duplicates of them because of the image blocks in the ref manual.
    Not sure I follow you. There is code for one image in there, plus the imagelink to enable you pop out that image into a separate window in FG.

    The imagelink xml needs to point an a node within the "<image>" tag to work, which then bitmaps to the actual image itself.
    Ultimate License Holder

  7. #7
    Quote Originally Posted by Mortar View Post
    Not sure I follow you. There is code for one image in there, plus the imagelink to enable you pop out that image into a separate window in FG.

    The imagelink xml needs to point an a node within the "<image>" tag to work, which then bitmaps to the actual image itself.
    Correct. The <image>...<image> records and files are all handled by existing export technology. I don't touch it. I just reference those links in my ref-manual. Same way you'd edit a ref-manual by hand and add the reference. Those records exist in the db.xml of any export with or without Author (assuming you tick the IMAGE check).

    Edit: Attached a sample exported db.xml using /export with Author. Maybe this will help for those not sure how this works. It's a simple single chapter, 2 story entries, the first one has 1 inline image.

    That image exists in the .mod file twice now. If I added another inline image of it on the second story entry there would be 3.

    Here are the settings I used when doing it.


    Contents of file:
    Attached Files Attached Files
    Last edited by celestian; October 1st, 2018 at 23:30.
    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  8. #8
    Mortar's Avatar
    Join Date
    May 2014
    Location
    New Brunswick, Canada
    Posts
    1,127
    Blog Entries
    18
    There is still only one image there. It just accessed in two different ways within FG to support different functions. So I am not sure how you are seeing double images. I am a little slow tonight so I am not quite getting what you see as the problem.

    edit- is it because you see that particular name twice?
    Ultimate License Holder

  9. #9
    Quote Originally Posted by Mortar View Post
    There is still only one image there. It just accessed in two different ways within FG to support different functions. So I am not sure how you are seeing double images. I am a little slow tonight so I am not quite getting what you see as the problem.

    edit- is it because you see that particular name twice?
    I think I see the confusion. I'm not talking about while viewing the image in the ref-manual. I'm talking about in the .mod file. The reference manual looks fine.

    ---
    Fantasy Grounds AD&D Reference Bundle, AD&D Adventure Bundle 1, AD&D Adventure Bundle 2
    Documentation for AD&D 2E ruleset.
    Custom Maps (I2, S4, T1-4, Barrowmaze,Lost City of Barakus)
    Note: Please do not message me directly on this site, post in the forums or ping me in FG's discord.

  10. #10
    Mortar's Avatar
    Join Date
    May 2014
    Location
    New Brunswick, Canada
    Posts
    1,127
    Blog Entries
    18
    Confusion clearing up. So in the exported mod file you end up with having two copies of the image in question?


    Ah...now I see the extra image that my desktop didn't want to cooperate with me
    Ultimate License Holder

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in