Is there a bug in external image generation when using tiddlywiki render?

97 views
Skip to first unread message

cpjobling

unread,
Jan 8, 2018, 4:40:44 AM1/8/18
to TiddlyWiki
I'm using the "Empty Edition" of TiddlyWiki 5.1.15 and generating a static version of my wiki for hosting on GitHub pages. The command being used is: 

tiddlywiki wiki --build

All seems well, but the static images that get generated seem to be corrupt and end up as broken images in the static site.

I did a bit of digging and noted that the images in the interactive wiki (I'm using the server version) are base64 encoded embedded binaries. 

The output image files are 6 bytes long and contain only the characters �w^~)�%.

Is this a bug and should I report it to the issue tracker?

PMario

unread,
Jan 8, 2018, 6:54:43 AM1/8/18
to tiddl...@googlegroups.com
Hi,

Can you post your tiddlywiki.info file?

-m

cpjobling

unread,
Jan 9, 2018, 7:11:04 AM1/9/18
to TiddlyWiki

My TiddlyWiki.info is on GitHub:

https://github.com/cpjobling/journal.cpjobling.net/blob/master/wiki/tiddlywiki.info

I noticed that images seem to have changed from internal to external when I accidentally saved my networked wiki with image toddlers open as drafts.

After that they where external in both networked and static files versions ... but the images themselves had not been properly exported.

Chris

PMario

unread,
Jan 9, 2018, 8:59:10 AM1/9/18
to TiddlyWiki
Hi,

This is definitely a bug. ... Please report it at github, with a reference back to this topic.

I'm not really sure, what happens atm. ...

-mario

PMario

unread,
Jan 9, 2018, 9:00:25 AM1/9/18
to TiddlyWiki
On Tuesday, January 9, 2018 at 2:59:10 PM UTC+1, PMario wrote:

This is definitely a bug. ... Please report it at github, with a reference back to this topic.

I'm not really sure, what happens atm. ...

but the image file are overwritten by tiddlywiki wiki --build externalimags command in a strange way.

-m

Jeremy Ruston

unread,
Jan 9, 2018, 9:03:58 AM1/9/18
to tiddl...@googlegroups.com
Hi Chris

If you use the build command without specifying a build target then it builds all of the build targets that are specified in the tiddlywiki.info file.

In this case, I think that means that the static images and the external images are overwriting one another. Perhaps try this to just build the external images build target:

tiddlywiki wiki --build externalimages

Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d20fa4b9-a793-44aa-bbb0-903eda9d15bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
Jan 9, 2018, 9:10:57 AM1/9/18
to TiddlyWiki
On Tuesday, January 9, 2018 at 3:03:58 PM UTC+1, Jeremy Ruston wrote:
In this case, I think that means that the static images and the external images are overwriting one another. Perhaps try this to just build the external images build target:

tiddlywiki wiki --build externalimages

That doesn't solve the problem. ... This command overwrites / corrupts the (by_Mars_2002).jpg image, which imo shouldn't happen.

If you do

tiddlywiki wiki --build externalimages
tiddlywiki wiki --build index

index.html is broken !

-m

PMario

unread,
Jan 9, 2018, 9:14:04 AM1/9/18
to TiddlyWiki
On Tuesday, January 9, 2018 at 3:03:58 PM UTC+1, Jeremy Ruston wrote:
If you use the build command without specifying a build target then it builds all of the build targets that are specified in the tiddlywiki.info file.

In this case, I think that means that the static images and the external images are overwriting one another. Perhaps try this to just build the external images build target:

tiddlywiki wiki --build externalimages

For me it seems, that the above command modifies the jpg.meta file with _cannonical_uri .. which is OK
But it also overwrites the .jpg file, which imo should not happen.

-m

PMario

unread,
Jan 9, 2018, 10:17:21 AM1/9/18
to tiddl...@googlegroups.com
Hi Chris,

I think I found it. Your tiddlywiki.info should look like this:

{
    "description": "Empty edition",
    "plugins": [
        "tiddlywiki/tiddlyweb",
        "tiddlywiki/filesystem",
        "tiddlywiki/highlight",
        "tiddlywiki/codemirror"
    ],
    "username": "Chris Jobling",
    "themes": [
        "tiddlywiki/vanilla",
        "tiddlywiki/snowwhite"
    ],
    "languages": [
          "en-GB"
      ],
    "build": {
        "index": [
            "--rendertiddler","$:/core/save/all","index.html","text/plain"
        ],
        "favicon": [
          "--savetiddler","$:/favicon.ico","favicon.ico"
        ],
        "readme": [
            "--rendertiddler","ReadMe","readme.md","text/html",
            "--rendertiddler","License","license.md","text/html"
        ],
        "externalimages": [
            "--savetiddlers","[is[image]]","images",
            "--setfield","[is[image]]","_canonical_uri","$:/core/templates/canonical-uri-external-image","text/plain",
            "--rendertiddler","$:/core/save/all","externalimages.html","text/plain"
        ],
        "static": [
            "--rendertiddler","$:/core/templates/static.template.html","static.html","text/plain",
            "--rendertiddler","$:/core/templates/alltiddlers.template.html","alltiddlers.html","text/plain",
            "--rendertiddlers","[!is[system]]","$:/core/templates/static.tiddler.html","static","text/plain",
            "--rendertiddler","$:/core/templates/static.template.css","static/static.css","text/plain"
        ]
    }
}

As you can see, I did change the formatting, so it's human readable again AND I did remove the second "--setfield" line, that killed the image files.

AND

Be aware, that the jpg.meta files have been changed by "--build externalimages" ... So you'll always need to ship index.html, with the "/images" subdirectory. Otherwise your images will not be shown anymore. ..

have fun!
mario

cpjobling

unread,
Jan 9, 2018, 11:39:36 AM1/9/18
to TiddlyWiki
Thanks Mario and Jeremy for looking into this for me. I'll update my repo with the new version of the info file and let you know what happens.

Chris

cpjobling

unread,
Jan 9, 2018, 11:49:00 AM1/9/18
to TiddlyWiki
Yes it worked. Thanks again.

I used Classic TiddlyWiki in anger some time ago but I'm new to TW5 and just starting to get my head around how it all works!

Chris

Reply all
Reply to author
Forward
0 new messages