James Fishwick

  •  Minimal
  •  CSS Tomfoolery

Automating swfdump to bulk generate flash dimensions or other metadata

Code Snippet, linux, Note to Self, Production Automation

No Comments


Share this post

Using a MarkLogic application at work to manage and deploy content. We have almost no available metadata nearly any of our thousands and thousands of video and flash content. We’re generating it by hook or by crook, often repurposing editorial transmittal grids into csv for import. Needless to say, stuff like native dimensions or the like have been lost in the sands of time – existing html embeds are done in a multitude of slapdash ways, with height and width varying greatly per instance.

I should also say that this is all legacy content being shoehorned into “responsive” courseware. So there are width restrictions now, when before these activities were just popped up in new windows with “100%” widths.

Anyway, when trying to place said swfs into the product, the embed codes for an entire disciple were completely wrong. Things squished, white spaced abounded. Turns out the person who loaded the original metadata set all the widths to the max width for the product (595 px) and then grabbed heights from the questionable html wrappers. But they didn’t in turn adjust this grabbed height in light of a new width. Oooooof. A complete mess!

I needed to start from scratch, but I was looking at several hundred swfs. Grepping the dimensions from the html was out, as they were suspect. As was opening each in Flash, I refuse to do manual labor! I needed a csv with all the filenames and native dimensions. If the width is over 595px, I needed an aspect ratio calculation done.

So swfdump and bash to the rescue!

Read more

textutil use cases

CLI, Note to Self, Production Automation

No Comments


Share this post

I don’t use my Mac as my main development/production workstation anymore, but its still my one-stop shop for all matter of text conversions.

While I have a very specific and regular use-case for textutil, namely converting Word .docs into barebones HTML or PDFS, there are plenty of features that make it a highly useful and general purpose tool. textutil can convert from/to txt, html, rtf, rtfd, doc, docx, wordml, odt and webarchive.

The basic syntax is:

textutil -convert fmt filename

Read more