jump to navigation

New Screengrab! release (and it has a new home) March 8, 2007

Posted by andy in : misc , 19 comments

Just a quick note to say that the new Screengrab! release (0.92) is available.

This release brings some nice new features (copy to clipboard, no need for Java, different file types, save a selection) and a new swanky website - http://www.screengrab.org - so head on over and check it out!

On locale maintenance. February 15, 2007

Posted by andy in : coding, screengrab , 3 comments

I just had a thought.

The whole point of locales is to externalise the language from the extension code into translatable blocks that reside in a separate area. Currently this resides inside the extension, but why not have it reside on a remote server and cache it locally?

Obviously your extension could ship with whatever translations it has, but if the person using it was French and you didn’t include an fr-FR version then it could connect to a server (let’s say Babelzilla) and request it from their servers (Babelzilla hold all of the translations anyway). If it was there, it would be downloaded and incorporated into your extension somehow (this bit is where the magic happens).

Translations would be tied to a particular version, so when a developer releases a new version, you could log in to their system and roll forward all translations or deprecate them. Then any new translations could be easily made and added to your extension without you actually having to do anything.

If people wanted a particular translation, then they could request it through the extension that managed all of this dynamic locale stuff, or they could just write a translation and submit it.

I think this is a great idea. I must ask Goofy what he thinks.

Pending Screengrab release

Posted by andy in : coding, screengrab , 6 comments

So I’m working on a new Screengrab release (which will coincide with changing the look of the website, so that it’s a little less bloggy and a little more about Screengrab).

The new release will feature some new features and bug fixes.

1) Fixed horizontal scrolling bug. Somehow horizontal scrolling got lost along the way. Either I stuffed up or it was changed in Firefox. Either way, it’s fixed now.

2) Grabs using Canvas. Firefox 2.0 (possibly 1.5) has full canvas support (notably toDataUrl) so I can now use the canvas instead of Java to do the grabs. We lose the funky scrolling around the page, but we gain much better performance. The Java version will still be kept as an option, as it is required in order to take complete grabs of pages that use plugins (swf).

3) Copy to clipboard. This feature will only work using Canvas, but you can now copy an image to the clipboard instead of saving it to disk.

4) Select a portion to grab. There is now a drag box allowing you to select only a portion of the window to take a shot of.

5) File type choice. This isn’t done yet, but it should make it in. You will be able to select whether you want a JPG or a PNG - we’re limited by what Firefox provides in this regard.

6) File extension bug. There’s currently a problem with ever growing extensions on files. I’ll try to squash this one.

The new release requires changes to lots of text, which will obsolete many of the current locales. I can’t decide whether to hold back the release while I wait for translations or to just go ahead and inconvenience a whole bunch of users.

People don’t talk about how annoying locale maintenance is, but it does hold development back, which is frustrating. I personally feel bad when I go to the Babelzilla guys and say “I’ve re-written the entire interface. Can you please re-write it 15 times too?”. Obviously I completely support it (I don’t want everyone speaking English. Otherwise it would be no fun visiting other countries) I just wish there was an easier way to do locales than bundling them into the extension itself. You have to make a new release every time you want to include a new locale.

GAAARR!!!! January 10, 2007

Posted by andy in : coding, screengrab , 11 comments

Developing extensions for Firefox is like an exercise in futility that pretends to be a challenge and leads you down the path to hell! Or maybe I really am just being too tricky, like Sisyphus, and I’m somehow being punished?

The development cycle for improving or creating an extension is as follows:

1. Think of great idea / Fulfil user request - Copy to clipboard
2. Imagine it won’t be too hard - Just copy some bytes to a buffer somewhere or something - setX(data)
3. Go looking for the Mozilla docs that pertain to the thing you’re trying to do. - surely it’s on “the interweb”
4. Fail. Look harder. - but where?
5. Eventually turn over the correct rock - Of course! I couldn’t find it because both Google and I are obviously too stupid.
6. Discover that the documentation only documents the straight forward text-only path, idly mentioning that you can use this interface to copy images and other stuff as well, but cleverly neglecting to mention the fact that this IS IMPOSSIBLE because there is nothing published anywhere that tells you how to do it.
7. Go looking for a particular component that you think might work but that is hidden deep within some archaic XPCOM interfaces that you can’t possibly find and even if you could, you’d have to trawl through the Gecko source to understand it because the documentation just doesn’t cover it and EVEN THEN, the source is next to useless so you’re just flapping your arms wildly in the air trying to figure something out.
8. Remember that you are part of a “great development community” with “active forums” and post a question.
9. Prepare a cup of tea as you wait for the iminent replies.
10. Watch lots of stupid questions get answered (the ones that Google CAN help on) for days while still blindly searching through source code, reference material and just trying random combinations of things you think could maybe magically work.
10. Give up.
11. Lie awake at night knowing that there HAS to be a way.
12. Start thinking outside the box.
13. Use a completely different approach that involves creating hidden images and hacking around in order to use some existing functionality that you found.
14. Have SUCCESS!! As long as your users will be happy to click an error box a few times and then somehow miraculously have it randomly work.
15. Try the old way again.
16. Harangue yourself for doing something so stupid.
17. Start thinking about doing those other projects you want to do. That game with the lasers and things.
18. Post to blog.

Please. If someone knows how to take an image, either as a Data URL, a series of bytes, or as an HTMLElement/XPCOMWrapper and get it onto the clipboard, tell me how you did it. Then I will tell you that it doesn’t work for me, but at least there’ll be some sort of discourse!

Then we can start trying to do it in Java as well as using the canvas.

Firefox 2.0 Compatibility October 25, 2006

Posted by andy in : screengrab , 36 comments

Okay. I’ve taken 5 minutes out to make the tiny change that can fix this immediately.

I haven’t tested it. I haven’t even downloaded FF2 yet (have I already mentioned that I am absurdly busy?) but I bumped up the maximum compatibility version number so it should work.

This is all the time I can spare for this until mid-December, so I hope it works.

The future of ScreenGrab! June 15, 2006

Posted by andy in : screengrab , 34 comments

It seems that I was dug recently. I must have missed it on the feed, but apparently I got a fair few digs. Yay for that!

The extra interest that this brings, means there are more people trying it out (which is nice) and asking more questions and pointing out bugs and so on. This brings to light the current problem that I have, whereby I’d like to do more work on ScreenGrab (and the other extensions I have planned) but I don’t have much free time what with study, work, wedding plans and a 3 hour round trip commute every day.

I have plans for upgrades, and I have an alpha with a couple of new features, but I just haven’t had time to do anything with it.

The things I’m working on are…
- being able to select a region to grab (using something similar to MeasureIt)
- removing my dependence on Java (much like the folks over at Pearl Crescent did with their PageSaver, based - like I said one would be eventually, on the Canvas widget).
- all those configuration options people keep whining about (default save to location, default naming, different file types, different menu locations)
- making a shortcut key to do the grab

I am also working on a super-secret project that I hope will actually be popular. :)

Is there anything else that people would like? Would anyone like to help? :) I can make a Subversion repository and I have a very easy to use environment for building these things.

Actually, maybe I should make a proper tutorial on how to do this. Making Firefox extensions is dead easy - the hard part is figuring out which parts of the DOM are the useful ones.

Thoughts? Comments?

Gosford (what a place!) May 14, 2006

Posted by andy in : life , 30 comments

We just moved to Gosford! For those who don’t quite know where that actually is, it’s about an hour’s drive North of Sydney, and about halfway to Newcastle.

This particular decision means that we now have an hour-and-a-half train ride into the big smoke every day: a highly unfortunate turn of events. The payoff? Free rent for five months and we get to live in an actual house with plants and a garage and stuff. We’re house-sitting! It’s something that I highly recommend everybody who’s saving money for a house or a holiday do. Firstly, it’s free. Do you need any more reasons than that?

From my perspective, I just moved to Hicksville, NSW. The place is bizarre, but possibly only because I seem to have become a bit of a lower North-shore snob. The locals in town appear to be, in most ways, crazed and (I AM CONVINCED) at least half of them are completely smashed. Absolutely certifiably drunk. They slur. They stagger. They ramble. They shamble. Even while getting their groceries. Even while selling me groceries. Probably while manufacturing my groceries in the factories around town. They have a mall with Big-W, Best and Less, Lowes and Go-Lo within an exceptionally close proximity of each other. They are a relatively coastal town but seem to have NO SHOPS TO BUY FRESH SEAFOOD! I even asked a local butcher. He just muttered something about that being a great idea for a business and shambled off to his corner. When we went shopping, we were the only people buying fresh fruit and vegetables.

At least, when I leave the country and head to the UK (anyone who wants to offer me a Java job in London - Hibernate, Spring and XP - Thoughtworks?) I’ll have fewer regrets. Sydney was really great to live in, and Canberra likewise. I doubt that I’ll say the same about Gosford.

Did I mention that someone told me that the Central Coast of NSW is the suicide capital of Australia? There’s usually a reason for that kind of statistic…

Screengrab 0.8! February 3, 2006

Posted by andy in : screengrab , 32 comments

And I’ve added 1.5.0.1 support (is that what we’re up to now?)

Screengrab 0.7 December 6, 2005

Posted by andy in : screengrab , 10 comments

Is up.

Check the page if you care. Just a bug fix and some more translations.

It’s been a while, and I’m still not back… November 29, 2005

Posted by andy in : coding, uni , 9 comments

so I’ll apologise for not updating the Screengrab thing. I’ll release a new version with a couple of minor fixes and some new languages very soon. Just have to finish my uni obligations.

This is just a quick note to say that Python generators are GREAT. Iterators are a pain to write, because you have to manage state and all that rubbish. Generators on the other hand just make them easy as pie. Write a couple of loops and put a “yield” statement in when you get to the next value you need. Dare I say “fantastic”? I dare!