Log
Up one levelA chronicle of Plone related development efforts
I found out the hard way that by default, plone maps all image/* mimetypes to the ATImage content type. That's bad. Why? Because plone's UI for ATImage instances is heavily reliant upon the presumption that the object can be shown *AS* an image. While browsing. With a browser. And that's just fundamentally untrue for the vast majority of image/* mimetypes. From relatively commonly-encountered stuff like image/x-psd, image/x-xcf, image/x-dib, to crazy things like image/x-niff and image/fax-g3, they all end up as ATImage objects in plone, despite the fact that none of them are directly renderable as an image by the browser. For all intents and purposes, they are nothing more than files, and there's a perfectly good content type for that, with a perfectly appropriate UI: ATFile. There are really only a handful of image formats that are conducive to rendering inline in http content, and even that subset is constrained within plone to the few that can be processed by PIL (in order to automatically generate multiple versions of the image at various resolutions).
Having all image/* files stored as an ATImage is, in fact, not the end of the world. Your plone site won't blow up or anything. But, as I said, the UI is just wrong for them. Browsing to them gets you a page template that's expecting an <img> front and center, and offers no direct link to download the raw file. So to actually download this 'image' file that you can't see, you have to know a bit of plone magic and manually craft a URL that coaxes the file out of plone. Hardly a desirable user experience.
So, my solution to this problem was to just tweak the mimetype-to-content-type mapping in plone so that only types that were legitimately presentable as images would be stored as ATImages, and all of the rest would default to ATFile.
This was easily accomplished by visiting the content_type_registry in the ZMI at the root of plone and doing the following:
- Change the existing
major_minorentry forimage/*to use ATFile. - Add a new
extensionentry directly above the originalimage/*and specify the few file extentions that should be ATImages:jpg jpeg png gif.
See the attached image for what it should look like when you're done.
After this change, I get exactly the behavior that makes sense, at least to me. Formats that can be presented and managed as a viewable image to a user browsing the site are stored as ATImage objects, and all other image formats are stored as ATFile objects.
I brought this topic to the plone user forum and mostly just got harassed by the forum's resident bouncer, who I still contend wasn't paying enough attention to grok the issue. Oh well. What I did makes perfect sense for an upstream default fix, and if that never happens, I'll just re-apply it for each version of plone I use that exhibits the original policy.
ooo -- a 'live' blog. I'm so hip. I'm attending Joel Burton's plone 3 bootcamp at Penn State, followed by the Plone Symposium East. Day 1 of the bootcamp was fairly casual, but still very valuable. Day 2 amped up significantly, and covered the nuts & bolts of the most important Plone 3 developer features. Not least of which is KSS -- which is, by my assessment, one of the most powerful webapp mechanisms I've ever seen. Basically, it shatters the atomic page request/response model. Here are a few KSS resources:
A few other doohickies came to my attention: