Thursday, September 16, 2010

Image Search Options v1.8.1

This version improves on the POST functionality introduced in 1.8.0, fixing many of the limitations, and making it easier to use.

The problem causing the odd Image truncation for large images turned out to be Firefox's automatic image resizing, or any other resizing of the image. An unfortunate limitation of the JavaScript image height and width attributes is that they are not the real image dimensions... To get around this, I have to load the image into a new image object which is not resized, and pull the height and width attributes from that. (as always, any better suggestions are welcome)

Background image search was pretty easy to add. It really should have been in the first iteration, but I dropped it in favor of an earlier release.

Finally, and probably most importantly, is that the POST image submission will no longer show the search page while loading the results, instead it will show "Loading. Please Wait...". The way the POST submission works is still exactly the same, but during loading of the results I overwrite the base search page initially with the status message so it is clearer what is actually going on.

So all in all its become even more complicated. The current flow is something like this...

Getting Results:
Selected Image->ImageURL->new ImageObject from URL->new Canvas from ImageObject->PNG DataURI from Canvas->Binary Image data from DataURI via AtoB->Binary Stream from Binary Image data->POST Request using Binary Stream.

Displaying Results:
Load Search Page in new Tab/etc...->Wait for search page load to finish->Overwrite its innerHTML with loading message->Wait for POST request to finish->Overwrite its innerHTML with POST request results.

isn't it just beautiful~ >_>;

2 comments:

  1. This is a very useful extension, I am happy to use it on Firefox. It would be nice if it had been ported to Opera 11.

    ReplyDelete
  2. Great extension.

    Would be perfect if we could have the site favicons in the context menu, though.
    Maybe in a next update?

    Keep up the good work.

    ReplyDelete