Is this possible? Building a zip file of images.

63 views
Skip to first unread message

Mark S.

unread,
Apr 9, 2021, 12:27:37 PM4/9/21
to TiddlyWiki
TW has a zip plugin that allows you to populate a virtual file system with text or html and then export it as a zip file.

Are there any tools or mechanisms in TW that would allow you to take the base64 images that are in TW and convert them to image data to be included in a zip file? I don't see any tools listed in the jszip plugin that would perform this conversion.

If this was possible, then you could have a work flow where you collect files and images (I'm thinking PDF's, jpgs, png) and later pack them into a zip file. Then you expand the them in the TW's root directory to create them locally on the hard drive and purge them from the TW itself. 

In this way you could conveniently maintain the size of TW, while still using it as an open-ended tool for collecting information from the web and other sources. You would just need to do a bit of periodic house cleaning, which might be a matter of two or three mouse-clicks.

Jeremy Ruston

unread,
Apr 9, 2021, 1:09:32 PM4/9/21
to tiddl...@googlegroups.com
The new publishing features that I’m working on do provide that exact functionality. The example sitemaps on the demo make a ZIP consisting of the images in one subfolder, and the html files in another, but it’s trivial to pick out just the route of the sitemap that saves the images.


It’s very much a work in progress, and not ready for anything except the most cautious tire kicking.

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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/da0faa46-0c50-4e89-ae82-f18b0bc5669cn%40googlegroups.com.

Mark S.

unread,
Apr 9, 2021, 10:50:05 PM4/9/21
to TiddlyWiki
It worked with my test image and PDF, which is pretty cool.

I notice that it's not in a separate plugin (well, it's in the core plugin), so I'm not sure what all tiddlers I would need to borrow.

I tried using it for exporting a bundle of tiddlers in a JSON. I used the var-<resource> to pass the filter expression. Unfortunately, the JSON exporter uses a variable with mixed case, but a field can only have lower case, right? So I needed to clone the exporter. I'm wondering if the JSON exporter template wouldn't be more versatile if the mixed case variable was replaced with a lower case variable. But maybe I'm going about it all wrong. Like maybe there's a plan to have an exporter style route?

Thanks!

Jeremy Ruston

unread,
Apr 10, 2021, 4:56:28 AM4/10/21
to tiddl...@googlegroups.com
Hi Mark

It worked with my test image and PDF, which is pretty cool.

Terrific!

I notice that it's not in a separate plugin (well, it's in the core plugin), so I'm not sure what all tiddlers I would need to borrow.

The publishing framework PR includes a number of tweaks across the codebase that would make it even riskier than usual to try to cherry pick.

I tried using it for exporting a bundle of tiddlers in a JSON. I used the var-<resource> to pass the filter expression. Unfortunately, the JSON exporter uses a variable with mixed case, but a field can only have lower case, right?

Ouch! Thank you, I hadn’t thought through that the current scheme restricts us to lowercase variable names. I was in any case thinking of changing the implementation to use <$importvariables> to pull in \define and <$set>’s from the route and sitemap tiddlers. That way one would be able to use complex filter expressions to generate the variable values, which I think will be required for the more complex sitemaps I’d like to support.

So I needed to clone the exporter. I'm wondering if the JSON exporter template wouldn't be more versatile if the mixed case variable was replaced with a lower case variable. But maybe I'm going about it all wrong. Like maybe there's a plan to have an exporter style route?

It’s important to be able to reuse existing core templates in the publishing framework, so the variable name case issue needs to be fixed somehow.

Best wishes

Jeremy.


Thanks!

On Friday, April 9, 2021 at 10:09:32 AM UTC-7 jeremy...@gmail.com wrote:
The new publishing features that I’m working on do provide that exact functionality. The example sitemaps on the demo make a ZIP consisting of the images in one subfolder, and the html files in another, but it’s trivial to pick out just the route of the sitemap that saves the images.


It’s very much a work in progress, and not ready for anything except the most cautious tire kicking.

Best wishes

Jeremy.


On 9 Apr 2021, at 17:27, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:

TW has a zip plugin that allows you to populate a virtual file system with text or html and then export it as a zip file.

Are there any tools or mechanisms in TW that would allow you to take the base64 images that are in TW and convert them to image data to be included in a zip file? I don't see any tools listed in the jszip plugin that would perform this conversion.

If this was possible, then you could have a work flow where you collect files and images (I'm thinking PDF's, jpgs, png) and later pack them into a zip file. Then you expand the them in the TW's root directory to create them locally on the hard drive and purge them from the TW itself. 

In this way you could conveniently maintain the size of TW, while still using it as an open-ended tool for collecting information from the web and other sources. You would just need to do a bit of periodic house cleaning, which might be a matter of two or three mouse-clicks.


-- 
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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/da0faa46-0c50-4e89-ae82-f18b0bc5669cn%40googlegroups.com.


-- 
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.
Reply all
Reply to author
Forward
0 new messages