posted May 28th, 2008

For a while I’ve been debating on an easy way to get small, quick updates out without having to write a longer post. (The Daily Bug thing a while back was no fun and too distracting.) I was gonna start Twittering, but 140 characters might be a bit short. I’m looking for quickness here, and forced brevity can take longer than it looks.

So I started a tumblelog: http://brandonrosse.tumblr.com/

This way I can quickly mention things as they come up, it doesn’t seem like I’m dead for two weeks, etc., etc. So for those interested in the tinier details, there’s an RSS feed—and if you use Tumblr—you can follow me. I’m not actually sure how that works; I haven’t tried it.

As a sidenote, I’m about a week behind on email responses—I’m really sorry! I’ll try to catch up soon. Despite the backlog, feature requests, bug reports, etc. are always, always incredibly helpful, so keep them coming!

posted May 16th, 2008

Naked light now has Aperture support!

Read more…;

posted April 30th, 2008

Naked light Beta 3.1 is finally out!

Flickr support

Naked light now supports Flickr!

Signing in is easy: You click ‘Authorize…’ from within Naked light, which sends you to a website in your browser of choice to sign in to Flickr and authorize Naked light. While Naked light and Flickr talk behind the scenes, Naked light itself never sees or knows your Flickr password.

Once you’re signed in, Naked light starts to download your photos. Similar to iPhoto support, it doesn’t import your photos until you tell it to. You can start editing photos right away, and if you save that composition, then it’ll import them.

Naked light also knows all of your contacts, and you can browse through their photos, too.

Uploading to Flickr is really easy: you just drag an image or a composition from the Library onto the Flickr icon. That’s it.

Flickr support has a few rough edges. There’s currently no way to delete photos, or edit metadata. The latter’s slightly more problematic because Naked light doesn’t give you the options to edit these prior to updating. Metadata’s a rather largish issue and will come later. Deleting photos is pretty quick and will probably pop-in randomly when I find a minute. It’s actually the user interface that’s the problem—I don’t want it to be easy to accidentally delete photos. There’s also two bugs related to uploading Compositions.

Toolbar

The dock is a dock no more.

The new toolbar can be dragged anywhere on the screen (including the edges) and doesn’t have nearly as many bugs/slowdowns/other issues.

I had plans to make it so that it would turn into a dock when you dragged it to the edge of the screen, and turn back into a palette as you dragged it away. Turns out that no one seemed to mind the dock going away, so it’s probably just going to stay a palette.

As mentioned earlier, I also ‘fixed’ the various bugs with the icons (by pre-rendering them). This means that Naked light is significantly larger in size, but starts up faster and more smoothly.

Closer to Universal

I mentioned this earlier, but my PowerMac G5 has officially kicked the bucket, which means it’s impossible for me to check out how Naked light runs on PowerPC machines.

Really, the only way around this until I can afford to buy a few test machines is to just release it anyway. So Naked light Beta 3.1 is technically Universal.

I fully expect it to crash, and crash horribly, but as always, bug reports are always welcome at brandon@naked.la. I’m sorry to put this on you like this, but it’s really the fastest way to getting PowerPC support at the moment.

Uploads and Downloads

Naked light now features managers for Uploads and Downloads. Right now this is mostly useful for Flickr, but this makes it easy to keep track of what’s going on.

Naked light tries to keep tasks like this in the background, so you can do other stuff while uploading.

Automatic Updates

Naked light now checks for updates in the background. At this stage, I don’t think a lot of people are actually getting any work done in Naked light (Naked light probably won’t be stable enough until the end of May-ish), but if you load up an outdated version, it’ll let you know.

Get it

Because of the Universality of the binary and the aforementioned dock fix, Naked light clocks in at over twice the size of the previous release with a whopping 3.6 MB download.

Naked light
Beta 3.1: The Compatibility Edition
3.6 MB
Download

posted April 21st, 2008

Naked light had a slight error with JPEGs saved with a DPI other than 72.

Naked light would handle the sizes gracefully, and in fact, used the right DPI setting to determine the size of your image. For example, a 300 DPI, 600 pixel-wide image would open up 2 inches wide. A 96 DPI, 600 pixel-wide image would be 6.25 inches wide. But when you actually looked at the image, it was plain to see that something was amiss:

The top image is a 600 × 375 pixel JPEG image saved from Photoshop via Save For Web…. The bottom is a 600 × 375, 300 DPI JPEG image saved via Save As…. Save For Web… strips all DPI information, whereas Save As… does not. Both images have identical pixel data, but Naked light chose to skewer the one with the DPI set.

Turns out this is a really common trap in Apple’s NSImage and NSImageRep classes that I’ve run into at least once before. 99% of the time, sending objects of these classes a size message returns the pixel size.

But this is purely coincidental: it actually returns the point size 100% of the time. It just so happens that most of the time, one pixel is one point. When it’s not, Naked light would incorrectly upload a smaller texture (in this case, ignoring 76% of the pixel data).

The fix is, of course, incredibly simple:

NSImageRep *rep = [image bestRepresentationForDevice: nil];
[image setSize: NSMakeSize([rep pixelsWide], [rep pixelsHigh])];

posted April 11th, 2008

Naked light used to ignore an images orientation metadata. Most modern cameras have some sort of accelerometer or gyroscope in order to determine the orientation of the camera when you take a shot. This way, when you tilt the camera sideways to take, say, a portrait, your image editing software would recognize this and properly orient the image.

Like yesterday’s bug, this is something that I had to previously ignore, due to time constraints.

There’s two parts to this bug.

First, I had to pull the orientation out of the file. This should be really easy, but wasn’t. Here’s an excerpt from the TIFF specification:

1 = The 0th row represents the visual top of the image, and the 0th column represents the visual left-hand side.

2 = The 0th row represents the visual top of the image, and the 0th column represents the visual right-hand side.

3 = The 0th row represents the visual bottom of the image, and the 0th column repre- sents the visual right-hand side.

4 = The 0th row represents the visual bottom of the image, and the 0th column repre- sents the visual left-hand side.

Not exactly user-friendly. Clearly, it was too hard for them to write, “Flip, then rotate 270˚ clockwise.” I drew up a little chart to double check everything, and I’m still a little nervous that I screwed it up.

Thankfully, Exif uses the same format for the orientation tag that TIFF does.

Second, I had to actually make the rotation work—in terms of getting the new aspect ratio right, rotating around the center of the image and not the origin, and so forth. As you can see, this was some pretty simple maths, but after Wednesday, that’s still not something I was quite looking forward to.

But now Naked light handles orientations correctly, and the world is a better place.

posted April 10th, 2008

This one’s a bit of a quickie.

In Beta 3, if you close a file with changes, it’ll warn you of the impending doom and disaster that will befall the land if you don’t save.

But if you quit, nothing. Naked light would irksomely and silently throw away your changes.

That’s now been fixed. This wasn’t so much of case of a bug in my code but rather a case of I didn’t feel like bothering with this sooner.

It’s not particularly difficult code, but it’s surprisingly complex for how simple it appears—each action at the document level (Save, Don’t Save, Cancel) affects what to do at the application level (Can we quit yet? Do I cancel?). This is one of those areas that I had to test and test over and over again to make sure I didn’t miss any edge cases.

posted April 9th, 2008

As you may know, Naked light no longer primarily uses Core Image, but instead uses the Naked Anatomy Engine. Anatomy is similar to Core Image that they both abstract OpenGL and the OpenGL Shading Language for 2D graphics, but Anatomy is designed directly for use with Naked light, which offers us lots of speed and stability bonuses. Naked light pushed Core Image to its limits, and well, broke it with all kinds of edge cases that Core Image wasn’t designed for—so while I was holding off on Anatomy at first, it soon become imperative.

That said, Core Image still has lots of great filters I want to take advantage of, so it’s necessary to have a bridge between Anatomy and Core Image. I do this through an OpenGL extension called the Framebuffer Object architecture, which let’s us use FBOs (framebuffer objects).

In order to draw something onto your screen, all graphics architectures must draw something into a special bitmap called a buffer (or, in OpenGL parlance, a framebuffer). FBOs are a special buffer that can then be used as a texture and redrawn into other buffers.

I can also use FBOs (and other textures) in Core Image by creating a CIImage object with the imageWithTexture:size:flipped:colorSpace: message.

So the process goes like this:

  1. We render the nodes to the left of a Core Image node (or group of Core Image nodes) into an FBO.
  2. We process the FBO using the filters in the Core Image node.
  3. We render that into a new FBO, setup as a CIContext.
  4. We then process that FBO in Anatomy through the remaining Anatomy filters.

Which works great, except for a few disastrous bugs. We had a twofer last week, this bug was a five-fer.

Things looked good when zoomed out. When you zoomed in, and the lower left corner of the canvas was out of view, portions of images would get shifted around, portions wouldn’t get drawn, mayhem occurred.

First, Step 1 would reuse the same FBO for different sizes. This is obviously wrong, and now Naked light throws away old FBOs when they start to smell and have the wrong coordinates.

Second, Step 4 wasn’t placing the final FBO in the right place in Anatomy coordinates. A few betas ago I changed Anatomy’s coordinate system to be resolution independent. I didn’t make that fix here, apparently. Instead of placing something at 1 inch, for example, the code would try to replace the image at 72 pixels. But it actually placed things at 72 inches, which is, pretty clearly, not good.

Third, Step 3 wasn’t rendering the Core Image result in the right coordinates in our FBO-based CIContext. Since part of the FBO would never get drawn into, you would see garbage leftover scraps of images in VRAM. On the left is the rendered FBO going into Core Image, on the right is the FBO I rendered the Core Image result into.

This is actually a poor image: I just restarted, and my VRAM is relatively unfragmented. Ordinarily, where you just see faint gray diagonal lines is a hot, hot mess.

It turns out I was using some pretty suspicious-looking math, including a fairly unconventional trick of setting the left and bottom bounds of the FBO to the negative of the left and bottom bounds of the rectangle the view is cropped to. Apple insists, “The Core Image coordinate space has the origin in the bottom left corner of the screen. You should configure the OpenGL context in the same way.” I quickly fixed that and got things working.

Apparently.

It turns out that negative trick was required to keep Core Image filters with point inputs happy. It kept the coordinate space consistent from FBO to FBO. Without it, zooming in and out caused all of these filters’ points to shift as you did so. So to keep Step 2 working, I had to undo this.

Fourth, I finally fixed the bug in Step 3 while keeping everything else working. It was actually really easy: I had assumed that the origin of my FBO would always be right in the lower left corner, as Apple suggested. This code must have predated the bug fix I had just previously broke again. It’s fixed, and now the output FBO matches the input FBO with zero shifting.

Finally, a slight aesthetic fix was needed. For speed reasons, I only send into Core Image what I expect out of it. This results in visual anomalies, but is fine for previewing—as Naked light doesn’t yet render final-quality images (that comes in Beta 4 or 5, I haven’t decided which yet. In Core Image terms, I wrongly assume that the Region of Interest is the Domain of Definition. You can see this in the error image: the image is bordered in black. I now clamp the rendering so that the edge pixels repeat indefinitely, which helps, but doesn’t alleviate, this not-really-an-issue.

posted April 7th, 2008

In Beta 3, full-out crashes are down dramatically from Beta 2. There’s still obviously lots of things that don’t work quite right, but crashes are few and far between. Actually, the number of bug reports coming in from people still using Beta 2 exceeds the number of reports from people on Beta 3 by a fairly large factor.

That said, above and beyond the number one cause of crashes is the startup sequence of the Dock. Even when the Dock didn’t crash, often some icons would fail to load, or all of them would be oddly garbled.

I made a rather strange and regrettable engineering decision with the Dock. The Dock automatically resizes, shadows, and blurs icons—and in the case of Core Image filters, applies that filter to the Core Image logo—at load time, rather than simply loading pre-rendered icons. This was mostly laziness on my part, and I’d been putting off fixing it until I reworked the Dock some more.

Now I’ve created a separate tool that renders all of the icons for me. The net result is a slightly larger binary (an whole extra megabyte—jeez), but faster loading times, less crashing, and no more garbled docks.

I don’t have any screenshots yet: the Dock is undergoing plastic surgery to become a toolbar, and wants to keep it’s privacy while in it’s mangled, half-breed form.

posted April 4th, 2008

Some programmers love bugs. Well, fixing them, at least.

That’s not me. I can’t stand bugs, nor can I stand fixing them. So instead I sequester them off on my to-do lists into giant Bug-a-thons, where, I swear to myself, I’ll fix ‘em all.

That doesn’t work out so well. After fixing a few bugs, I get burnt out, and have to find non-programming tasks to do. This of course, results in not only wasted time, but Bug-a-thons that turn into a week instead of a day, causing me to push back releases and ultimately simply ignore a bunch of the bugs.

So, for my sanity, I’m doing a bug a day. And the first one is with exporting images.

Export

Exporting used to not actually create an image. The preview would be blank, and no file would ever get saved.

This turned out to be two compound bugs. First, I had never told the Anatomy renderer what OpenGL context to use. This was fine in earlier betas, but would lead to buggy behavior and has since been fixed. Apparently, I didn’t fix it in all places.

I also was using an apparently deprecated code path. Apparently, I’ve reached the point in Naked light where I can deprecate code and totally forget about it. In any event, instead of rendering your composition and returning a bitmap, that code path was just returning nil—Objective-C speak for nothing. Objective-C has an often nice but occasionally irritating feature in that telling nil to do something doesn’t do anything, rather than generating an error. So when I told this nothing to draw itself, JPEG compress itself, or save itself to your hard disk, all I got was a whole lot of nothing.

Fixed!

Bonus Bug

There used to be an intermittent extra gap between the top of the library window and the first row of items.

Annoyingly, this gap would come and go as you zoomed in and out, causing all kinds of unsightly flickring. The gap was caused by a rounding error in the line of code that checks to see if a line was full. Literally, all it took to fix this bug was a carefully placed “+ 1.” Fixed.

posted April 3rd, 2008

The Naked light Pre-purchase Program was a resounding success. Not just better than expected, better even than I’d hoped. Seriously, 3× better than I’d hoped. It was kind of ridiculous.

Was.

Pre-purchase sales stopped precipitously and abruptly last week, after only a few days, and I’m rather dependent on sales continuing–not necessarily as well as they started off, but well enough that I can you know, pay the bills.

At first, of course, I was really upset at this. Had demand really already been fulfilled? What would it take to bring back demand for Naked light? Would I be able to do that before I ran out of time (in other words, money)?

Yesterday I figured something out that, with 50/50 hindsight, is now really obvious. The last day of really good sales was last Monday, March 24th. The next day, Tuesday, the 25th, was my first blog post after the announcement of the Pre-purchase Program–a casual post about the Dock. The Pre-purchase Program isn’t mentioned anywhere else on my website.

In other words, when the Pre-purchase Program was no longer at the top of the blog, people stopped (just about, at least) pre-purchasing.

Or, in chart form:

Sales Chart

Chart courtesy of Microsoft Paint. Apologies for the Arial and the dumb quotes.

Let this be a lesson to all software developers who aren’t well in tune with the obvious: make it really, really easy for people to give you money.

So a couple of things need to change. I have to be a bit more vocal in advocating the Pre-purchase Program. I really need sales to continue. Y’know, the kid’s gotta eat. This means three things:

  • The Pre-purchase Program needs to be featured more prominently on the website and blog.
  • I need to put really tiny and tasteful messages in the RSS feed. These will be totally quiet and not at all annoying, I swear and/or promise.
  • I need to put a nice little notice in the beta. Again, totally quiet and non-intrusive. No pop-ups or modal dialogs, just a little note in the corner of a window. Think more Panic-style than David Watanabe-style. Plus, this’ll be turned off when you enter in your license.

I think I have figured out the right balance of letting people know about the program while making the program subtle enough to be easily ignored by those that have already bought a license or don’t care to. If I don’t get it right, of course, drop me a note.

Uh oh, what’s this?

Naked light Pre-purchased License
$99.99
$49.99
plus tax in California and Connecticut

While I’ve got your attention, the Naked light Pre-purchase Program totally needs some love.

For more details, see the Naked light Pre-purchase Program.

Thanks!