Photographic trends I just don’t understand

It is no mystery that I have a passion for photography. Having published two books and posting regularly on my Flickr stream, and knowing the theory of optics in addition to just snapping around, I think I know what I’m doing. Mind you, this does not mean I consider myself an artist. It may sound cliché, but I am strongly convinced that artist is a definition that others should cast upon you, rather that something you call yourself. In fact, despite what I am often told, I do not feel like my photography is that good. It’s not false modesty: I really don’t think so.

However, ever since the introduction of cheap compact cameras (and, god forbid, cheap reflex cameras), photography became mainstream. There is nothing inherently wrong with it – the more the merrier, right? – yet there are some trends in photography that I simply do not understand, and some that are just plain bad. Needless to say, these annoyances are most often perpetrated by hipsters or (gasp!) wannabe hipsters. Now, it has to be clarified that my concept of hipster includes not just the traditional, American-ish hipster, but more generally all those “subcultures” – trust me, quotes were never more appropriate – that strive to be alternative and ultimately fail to be unique. This includes, admittedly due to my cultural vantage point, the decadent leit-motif that seems to permeate the life of Italian teenage girls and young women. I may write specifically about this matter, as it’s not specific to photography.

So, without further ado, let me present a roundup of the most annoying trends in photography today. It goes without saying that this is merely my personal opinion.

Continue reading “Photographic trends I just don’t understand”

And so our story begins…

Earlier today, I joined the iOS Developer Program. After paying my entry fee and patiently waiting for about an hour for the meticulous Apple Robots to type an e-mail, I am now a registered iOS Developer, ready to attack, besiege, seize and conquer the App Store. I am currently targeting iPhone/iPod Touch only, reserving plans to expand to iPad land for later, after feeling the waters.
Stay tuned for updates. I plan to start writing on this blog again soon.

And so our story begins…

Pictures from the partial solar eclipse, Jan 4 2011

This morning, a partial solar eclipse was visible throughout Europe. I took some pictures, and posted them.
Click on the thumbnail to read more and view it in full resolution:
Partial solar eclipse of Jan 4, 2011 from Central Italy + sunspot

Flickr is the best place to showcase your photography, here’s why

After a long hiatus, a few months ago I started getting into photography again. The question immediately arose: how do I share my work?

Making a website from scratch was a no-go: too much work, too little motivation.

A CMS, such as Coppermine? Not really, I have used several in the past and they felt clunkier. Plus, a personal website is very slow to gain any traction, if it ever does.

I considered going back to my first love, Pbase, only to feel as if I were walking through Pripyat.

Two options remained: DeviantArt and Flickr. I wasn’t too keen on either, given the previous impressions I had had from both. In any case, since I already had basic accounts on both, I went ahead.

Continue reading “Flickr is the best place to showcase your photography, here’s why”

Printing in grayscale with AirPrint

Did you all think I was dead? Unfortunately for you, I am not. I’ve just been fairly busy with work and with my renewed interest in photography. Speaking of which, all of you should follow my Flickr photostream, which I update daily.

So, you’ve got the shiny new iOS 4.2 on your iPhone 4 and you have enabled AirPrint sharing on your Mac, using either the free Hacktivator or one of the commercial packages. You are very satisfied (albeit a bit doubtful about actually using it in the future), except for one thing: it prints in color, and you really wish it could print in grayscale, because toner is not cheap.

Continue reading “Printing in grayscale with AirPrint”

How to use resizeTo in Safari (if it doesn’t work)

Many people are probably familiar with the fact that most browsers allow Javascript code to be entered in the address field. That’s the magic behind bookmarklets, which simply spare the user the hassle of manually typing long, convoluted and obfuscated Javascript statements.

While it’s usually pointless to do so, there is one case in which it makes perfect sense: resizing the browser window to an arbitrary size, in order to test what a website looks like. Essentially, by setting the browser window to a size such as 1024 x 768, one can have a relatively reliable idea of what the current website would look at that screen resolution. In truth, one would have to take the graphical elements of the operating system in question, but it’s usually a fine way to get an idea.

The code to do so is very simple:
window.resizeTo(width, height);

Therefore, if we want to set the window to 1024 x 768 pixels, we type the following pseudo-address:
javascript:window.resizeTo(1024, 768);

and press enter. A few things worth noting:

  • Capitalization is important. It is resizeTo, with a lowercase “r” and a capital “T”
  • There is no space, nor any slash, after the colon
  • The width and height have to be separated with a comma, and (of course) have to be integers
  • The semicolon at the end is optional, but if you’re a programmer it will be natural to type it
  • In some browsers, you can omit the “window.” part, as the current window is implied

This is all good and great, and works in most browser.

Safari, however, only allows this intermittently. Since I spent some time making tests to figure it out, here is a tip: Safari will execute resizeTo only when there is one (and only one) tab in the window.

I’m not sure whether this is caused by a specific setting on my machines, or if it’s a default, or if it can be even changed, but I can see the point in this behavior. Since some websites have the bad habit of resizing the current window to full screen (an annoying and pointless habit, if you ask me), Safari blocks the execution of such command in order not to disrupt the concurrent navigation of different websites/pages.

It’s as if it said: “if this is your own window, do what you want with it; if not, you’ll have to respect your tab brothers.”

So, if resizeTo isn’t working for you, drag that tab out of the bar so it’s instantly opened in its own window, and try again.

Manual duplex printing on a laser printer

My laser printer, a Samsung CLX-3175, does not have any tool for automatic duplex printing. Achieving such result manually is not difficult, but may take some trial and error in order to get the settings right. That’s exactly what I’ve done, and I’m writing this post as a note to myself. Should it be useful to anybody else, however, by all means let me know with a comment.

Keep in mind that this is for my own printer, and that I use OS X 10.6 “Snow Leopard.” Results may vary with different printers and/or operating systems, so make your own tests. If your printer outputs pages “face down,” this will probably work as it is. Most ink-jet printers on the other hand output prints “face up,” so some adjustments will be necessary.

In any case the steps for my own printer are very, very easy (once you’ve figured them out correctly):

  1. Print all odd pages in normal order
  2. If the total number of pages is an odd number, take the last sheet and put it away for the time being
  3. Take the (remaining) sheets and put them back into the tray after rotating them 180°. Do not flip them in any way!
  4. Print all even pages in reverse order
  5. If you put the last sheet away in step 2, put it back at the end of the stack
  6. There is no step 6

Enjoy. :)

Prettifying URLs with fake subdirectories using mod_rewrite

Lately, I have been trying to define a common basis for most of my web projects, since I often end up reinventing the wheel every time. I have tried a few PHP frameworks, but none of them tickled my fancy, but I have complicated tastes. I am known for reimplementing something from scratch rather than wasting time adapting other people’s code to my needs, and it’s often much faster too.

Therefore I have been working on JBFW, my very own PHP/Javascript framework. One of the key components of it is pretty URLS and a centralized index.php to handle most of the things.

If you access, the server will transparently route that to At that point, index.php runs the news module if it’s present, and then loads the news template (possibly showing the result of what was done in the module, if it was called at all.) I find that it’s a very slick and modular way of handling things, as static pages only need new templates and boom, they are live, with the rest of the framework readily accessible.

The mod_rewrite configuration for such a behavior is as follows:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?pagename=$1&%{QUERY_STRING}

This means: if the requested filename is not a directory and is not a file, route the request as described (knowing something about regular expressions, or being proficient in creative swearing — which goes hand in hand with regexp — comes in very handy at this point.)

I used a similar, but coarser, approach on my own main website, There, I even used fake subdirectories, so that will have it show the photography-book-glimpses template. Neat, but doesn’t work with real subdirectories. It’s not a big problem on that site, but when you need to have a separate administration section, you need real subdirectories. The problem is that, using the approach I described above, into, and while the correct function could be run in PHP by mangling the request as it’s done for the “top level” modules, it could quickly turn into a nightmare.

The solution is to add another set of mod_rewrite rules, as follows:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((.*)/)+(.*)$ /$2/index.php?pagename=$3&%{QUERY_STRING} [L]

Yes, that’s incredibly messy, and I’m pretty sure that there is a better way to do it. However it works, and for now I’m going to concentrate on finishing the website and go back to it later. What this does is: if the request has one or more blocks ending wish a slash (the directory), followed by something else (the file name), it is routed to index.php inside that directory, using the file name as a parameter to pagename, plus the original query string as usual. The [L] at the end tells mod_rewrite: please refrain from doing any other change, this is flaky enough. This ensures that effectively calls

Note that this is another block of RewriteCond and RewriteRule, and goes before the original one. I tried to put them together, since the conditions are the same, but after fifteen minutes of trying all combinations I gave up. I’m sure I was one attempt away from getting it right.

A very clever thing (ok I’m kidding, it’s a side effect I hadn’t fully realized but I’m glad it’s there) is that addresses such as img/logo.png are not rewritten because those files do exist. It would probably make sense to exclude common file extensions, such as image files and javascript, from this kind of mangling; or even better, make it only work when the “file name” part does not have a dot in it. I’ll find a way to do it, at some point.

To finish up, an extra little trick that can come in very handy when you want to make sure that certain files are not downloadable by anybody:

<Files ~ "\.sqlite3$">
Order Allow,Deny
Deny From All

Make sure that there are no spaces on either side of the comma in the first line. I was quite frustrated because I kept getting the infamous error 500, and there it was.

I hope this spares someone from wasting as much time as I did with this kind of thing!

Fix broken IMAP attachments in

I have recently started getting broken images in Often, when someone sent me relatively big pictures (over 1 MB in size), the image ended up being corrupted, with a smaller file size that one would expect. This results in a picture that’s visible up to a certain point, and then rest is usually filled with solid grey by the viewer.

While this could happen because the attached image is indeed broken — that is, if the sender is attaching an image that’s already corrupted on his/her machine —, it’s unlikely that the file gets mangled during the transit. To begin with, the base64 encoding adds lots of CRC (1/3 of the file size, and this alone explains why it’s a very bad idea to send big files through e-mail). In addition to that, no MTA will accept a malformed message: MIME parts must be completed with an extra boundary marker, and the infamous dot on its own line has to be there to commit the DATA part. Using a webmail system makes it even more difficult to corrupt a file in transit, because there is the extra uploading step that ensures that the attachment reaches the server before the message is constructed and finally sent.

If none of this makes sense and you want to know more, please refer to RFC 2821, but the point is that it’s virtually impossible for several people to send corrupted images. It’s way more likely that the problem lies within the recipient’s client.

With OS X’s, these problems happen when there is some communication failure during the download of the message. Essentially, if the download gets interrupted for any reason, may be unable to notice and will be perfectly happy with the broken file. There are two ways to fix this:

  • The hard way: go to ~/Library/Mail, and for each INBOX you may have, delete anything inside the Attachment folder
  • The easy way: select your Inbox folder within and simply run Mailbox → Rebuild

That should take care of the problem. Note that the Rebuild procedure will redownload every message from the server again with all the attachments, essentially resynchronizeing the local cache with whatever is on the server, fixing any discrepancies. It may take some time, but you can keep an eye on the progress by opening the Activity window (Window → Activity, or ⌘0.)

iPhone 3G comes back to life after installing iOS 4.1

As I had predicted, Apple introduced iOS 4.1 at the iPod event last Wednesday. It is officially scheduled for release on September 9th, but there are ways to download the Gold Master that was seeded to the members of the Apple Developer Program. I am not one — not yet, anyway — but I couldn’t take it anymore.

The installation was extremely simple, with no remote activation or anything like that. This is because the GM is essentially the very same that will be pushed to the masses in a week. I simply pressed the option key while clicking on ‘update’ in iTunes and I got a dialog window to choose the .ipsw file from the disk. After that, it took its sweet updating time and lo and behold, my two-year-old device was running the latest incarnation of iOS.

I am extremely pleased to report that my iPhone 3G has come back to life. After using it extensively, to the extent of purposefully opening all sorts of apps in rapid succession to make it crumble, it stood strong. I can assure you that this is not placebo: it’s pleasant to use again. Most importantly, it doesn’t randomly freeze for a random amount of time in a random fashion in random apps. Sometimes it does take its time when the lock screen comes up (perhaps it does some cleaning when it automatically locks, and it reloads something?), but other than that, it’s completely different from 4.0.x.

Mind you, this is still a two-year-old phone and there have been two major revisions since it came out, so do not expect The Flash in your iPhone (hey! that’s a geeky double-entendre! neat!), but it’s definitely a major improvement. One disappointment stands, though: 3G units just don’t have the hardware to run the Epic Citadel demo, but — once again — is anybody really surprised by that?

The real irony is that my iPhone 3G was such a pain to use in the past couple of months (especially with the annoying freezes) that I honestly can’t even say whether 4.1 makes it as fast as 3.1.2, or if it’s still slower than that. All I know is that it’s faster than 4.0.2, and that’s all I care about.