momijizukamori: Green icon with white text - 'I do believe in phosphorylation! I do!' with a string of DNA basepairs on the bottom (Default)
Cocoa ([personal profile] momijizukamori) wrote2016-11-05 10:58 am

You Might Be A Programmer If...

...your solution to crappy bundled label-making software is to spend two hours figuring out a way to do it programmatically, which at current time involves gLabels, three different methods of editing CSV files, and ImageMagick commandline scripts, but which I may be able to coalesce into one commandline script, one method of editing CSV files, and gLabels.


-gLabels allows you to programmatically create multiple unique labels from a CSV file and a template, including unique images specified by a filepath in the CSV template.
-Unfortunately, it has the following three drawbacks: 1) It doesn't maintain image ratios for the inserted images, and instead stretches or squishes them to fit the provided image box; 2) it doesn't reflow text particularly well; and 3) you have to make the same number of copies of each entry from the CSV.
-The solution to (1) is to use ImageMagick to batch process the images and add whitespace as necessary to make them all the same dimensions (this isn't an issue for most BPAL releases, but I'm dealing with two series that use photos or paintings as the label art so the dimensions are all over)
-The solution to (2) is, at the moment, to use multiple templates and manually break long lines in the titles, which is not ideal but I think the only way around it is to use something really high-end like InDesign which supports reflow really well. gLabels supports auto-resizing text but if you turn that on for a field, it won't line wrap, and you can't have multiple font styles in one text object.
-The solution to (3) is to copy each row of the CSV the number of times you need it. I've been doing this in a text editor, because it's faster than inserting and copying new rows in either of my spreadsheet editors.
-...And then I've been using both Gnumeric and LibreOffice because Gnumeric copies and pastes text as plaintext, while LibreOffice copies formatting and pops up a dialog box EVERY TIME to ask how you'd like to paste in the text which is super-obnoxious, but if you copy an image and paste it into Gnumeric it inserts the image, and in LibreOffice it inserts the filepath (though I just experimented and if you copy the entire image file in a file manager rather than right-click -> copy image from an image-viewer, it inserts the filepath in both programs.)

The super-hardcore solution to all of this is to fork gLabels and add these features, but the less hardcore solution is to just write a script that processes the text and images nicely and minimize the amount of fiddly editing necessary.


All this because the Avery software is shitty and lost three hours of my work because it said it had saved it but hadn't really.
batrachian: Dom (from the webcomic Megatokyo) talking on a phone (Dom)

[personal profile] batrachian 2016-11-05 03:34 pm (UTC)(link)
Approval.
batrachian: (Smug Frog)

[personal profile] batrachian 2016-11-05 04:00 pm (UTC)(link)
Official corporate shovelware is less than good? I am SHOCKED. ;)
batrachian: Sonoda-san (Megatokyo) with glasses off, rubbing his forehead (Sonoda)

[personal profile] batrachian 2016-11-05 06:46 pm (UTC)(link)
700MB? Oy vey.

*passes the flamethrower*
batrachian: A frog, probably of South American vintage (Default)

[personal profile] batrachian 2016-11-05 11:15 pm (UTC)(link)
And my apologies for tone; was not my intention to be condescending.
batrachian: (Purple Frog)

[personal profile] batrachian 2016-11-06 05:24 am (UTC)(link)
Tone is tricky on the internets. No harm, no foul.
azurelunatic: Vivid pink Alaskan wild rose. (Default)

[personal profile] azurelunatic 2016-11-05 04:12 pm (UTC)(link)
... fun!
silveradept: A kodama with a trombone. The trombone is playing music, even though it is held in a rest position (Default)

[personal profile] silveradept 2016-11-05 09:22 pm (UTC)(link)
Waaaugh. Awesome that you did it, horrible that it was necessary.