Thursday, November 24, 2016

photocap.php : offline photo captioning hack

So, I haven't posted much lately, I was in Malaysia for a bit under two weeks.

One thing about vacations to Malaysia - lots of pictures...

(If for some reason you want to see more, go here and start clicking through up to the 21st)

Anyway, in the current social media world, I tend to double post; I put photo galleries on FB, where friends and family are more likely to see it and comment, but I also like keeping them on my blog as their permanent home.

FB has polished photo gallery editing, but my blog doesn't. Also, where Internet was spotty (like at our resort; downloading was fine but uploading was terribly slow) or non-existent, I wanted a tool to edit captions offline, one that made it easy to later put the photos onto FB and my site. For FB, it's still pretty manual copy and pasting, but it goes fast. (Haven't researched if there are any better ways to automate making albums with captions, but frankly I do it so rarely it might not be worth more dev time.) For my blog I can just generate the appropriate HTML and copy and paste (modulo some search and replace fiddling I do for my blogs way of handling thumbnails and upload folders)

PHP has a convenient built-in webserver, from a shell run 
php -S localhost:8000
(or whatever port you like)

So here's the simple editor I came up with, a one-file-wonder. It has a bit of Javascript that I kept vanilla (I do like when everything can just be one file), it writes out a tab delimited CAPTIONS.txt file, and it stores deleted photos in a folder called "killem".

Below is a link to the code for my future reference, I just need to copy and paste it into a file named "photocap.php" in the same folder as all the photos. I ran into a few PHP quirks, like I had to encode filenames rather than use them as straight up keys because "." is not allowed in a key.

Also the code is pretty rough, but that's what I get for hacking on a sunny beach while drinking...

I published the code at github.

Friday, November 4, 2016

the art of the emoji

MOMA's Paul's Galloway writes The Original Emoji Set Has Been Added to The Museum of Modern Art’s Collection:
I tend to use emojis more freely than some of my correspondents, I think I'm more aware of how chilly of a tone text messages can have without them, or at least some gratuitous exclamation points.

I don't mind yellow-faced smilies, especially when picked from a list, but I'm sometimes bummed the standard is to automatically translate punctuation smilies like :-) into the cartoon version. It takes a semi-clever typographical joke into a very literal thing, and sometimes has issues with expressions from different emoji sets setting carrying somewhat different moods. (Or stuff like Apple swapping the gun for a squirt gun.) Also sometimes I worry that we're regressing into simple pictographs. On the other hand Wired had a guide to some of the way teens were using emoji in somewhat more nuanced ways.

I think you can tell Asia has driven a lot of the Emoji standards (I mean, even besides the name which has supplanted Emoticons and Smilies.) For instance in the 1990s, at least for me
:-) was smiling, and
:-D was laughing
but those are called"slightly smiling" and "grinning" respectively,  it seems, and the laughing involves tears.

One thing I discovered playing Pictionary with Germans is that, even an English, a frown is defined as the gesture of the brow, not the lips ("furrow one's brow in an expression of disapproval, displeasure, or concentration.") Similarly, historically Asian emoticons often emphasize the eyes rather than the mouth- In 2003 I blogged about about some Japanese Smilies:


Those were all ASCII based... as Unicode caught on, of course there was even more flexibility in character-based emoji perhaps reaching it's pinnacle with

I do love that guy.

the kingdom of nouns

If you like a good (if old) rant you might enjoy Steve Yegge's Execution in the Kingdom of Nouns.

I've always thought verbs were a bit underrated. Earlier this year I wrote:
I don't care so much about the interior lives of things; people and computer objects alike should be judged on what they do, not what you think they "are". (Conversely, from a Bayesian analysis point of view, what they "are" will influence what they are likely to "do", so getting a handle on what they "are" is better than relying on individual observations of their action.) 
It reminds me of that Geocities-era classic Object Oriented Programming Oversold! - though you need the Wayback machine to see it.

The Kingdom article says
It's odd, though, that Java appears to be the only mainstream object-oriented language that exhibits radically noun-centric behavior
If you read You Have Ruined Javascript, you see Angular giving the radical noun-ism the old college try (admittedly well after the Kingdom article was written.)

Image Capture for moving large files and photos in bulk

Macbooks are getting rid of the SD card reader.  Here's Apple exec Phillip Schiller defending that decision in The Independent:
The new Pros have no SD card slot for a camera memory card. Why not?
Because of a couple of things. One, it’s a bit of a cumbersome slot. You've got this thing sticking halfway out. Then there are very fine and fast USB card readers, and then you can use CompactFlash as well as SD. So we could never really resolve this – we picked SD because more consumer cameras have SD but you can only pick one. So, that was a bit of a trade-off. And then more and more cameras are starting to build wireless transfer into the camera. That’s proving very useful. So we think there’s a path forward where you can use a physical adaptor if you want, or do wireless transfer.
I'm not sure I buy the "cumbersome" argument; when not in use it's recessed, and when in use, well, every other port has a big old wire sticking out of it, so I don't see it as a real point.

I find the SD card a great method of generalized file transfer and backup, not just a tool for getting photos off cameras, and it was convenient not to need the reader, though they're cheap. But, just another dongle - dongles which will likely be the way of your world for the next two or three years if you upgrade your Mac or iPhone.

Of course, some of the SD Card indifference is justified because so much amateur photography is done by smartphone now anyway. (Which is probably the strongest pitch for "it's wireless now", camera to wifi last felt really clunky and gimmicky to me, though maybe I'm out of the loop with recent advances.) Still, I find wireless transfer slow, and in my curmudgeonly oldness, I have a strong preference for dealing with photos as regular files and not being beholden to some service for another.

So as a reminder, Macs come with the "Image Capture" app, which I think is the fastest / simplest way of getting photos and videos off of iOS devices in bulk.

Incidentally, I learned about that quote from Shaun McGill's excellent Lost in Mobile blog. 
 His stuff has been through several models seeking a business model, but it's always a great view of modern consumer tech. (And I've always liked his How Did We Get to the iPhone? which traces through the PDAs and the like that provide the evolutionary backdrop for that 2007 wonder.)