October 07, 2013

Chooser version 36

Back when I switched to using a flash for the top image, one request was that I allow people to store the image they were looking at. I can't do that directly out of the flash file because the flash security sandbox doesn't permit it. You either can manipulate local files, or you can manipulate files on the web, but you can't do both.

I never understood why anyone wanted this. But apparently some people did. And it just now occurred to me that I can give you something nearly as good, and I just implemented it. In the upper right corner now is another magic invisible button. If you click it, a new browser window or tab (depending on how your browser is set to treat target "_blank") opens with the current image in it, and from there you can drag-and-drop or right-click to your heart's content.

The lower right corner is a magic button which causes the flash file to choose a new image to display, on every click (for IE) or every other click (for Firefox). I still don't know why that doesn't work correctly for Firefox (and certain other browsers) and I still don't have the slightest idea how to fix it. I still believe it's a bug in Flash, and it won't change until Adobe does something about it. I don't think I'm doing anything wrong.

The lower left corner is a button that causes your browser to load the main page. The upper left corner acts like the lower right corner except that a mouse hover brings up a panel displaying a bunch of internal information about the flash.

UPDATE: If you're looking at an animation, the upper right button will open that in a new window/tab, too. But the animations are flash files themselves, so you can't drag-and-drop or right-click them to save them. Sorry; nothing I can do about that.

If you really need your own local copy, for some reason, then in Firefox you can open a new tab to "about:cache" and then dig it out of the file cache. There's no equivalent in IE; Microsoft thinks we're too stupid to be allowed into the cache and does its best to prevent us from getting into it.

UPDATE: And having written the above, I just now realized what I was doing wrong that was screwing up Firefox (and Chrome etc.) and fixed it. (Yes, it was my fault.) The lower right button should work every time now. At least it does in Firefox for me.

So the current version of Chooser is 37.

UPDATE: By the way, it's better now than before. Used to be, the top image was always named "top.jpg". But now it will have a unique name, so you don't have to rename it.

Of course, sometimes the name is something like "GuP.zip:0101.jpg" so you better hope that having a colon in the name doesn't screw up the operating system of your choice. (Windows doesn't mind, but I have no idea how MacOS handles that.)

Posted by: Steven Den Beste in Site Stuff at 02:35 PM | Comments (8) | Add Comment
Post contains 510 words, total size 3 kb.

1 So what was the problem?

Posted by: RickC at October 07, 2013 03:54 PM (swpgw)


I needed to add this line of code at a critical place:


Posted by: Steven Den Beste at October 07, 2013 03:56 PM (+rSRq)


I suppose that's not really a fair answer.

I am dynamically allocating an object to hold the image to be displayed. But I was reloading it by using the same allocation code, without deallocating it first. The IE version of the Flash runtime evidently was saying, "OK, This isn't right but I know what you're trying to do, and I'll do it for you." The Firefox version seems to have used the new allocation as an indication that it should deallocate, but it didn't go beyond that. Then, the next time there wasn't any object, so it allocated it properly.

Posted by: Steven Den Beste at October 07, 2013 04:32 PM (+rSRq)

4 Colons are illegal characters in filenames on Macs (hfs reserved them for path separators, not sure about hfs+ offhand), but Firefox and Safari replace them in the save dialog with an underscore or hyphen (respectively). I imagine Chrome does something similar, so Mac users should be good.

Thanks for the update.

Posted by: benzeen at October 07, 2013 07:58 PM (w1Fue)

5 Actually, it looks like IE on Windows is replacing the colons with underscores, too.

Posted by: Steven Den Beste at October 07, 2013 08:34 PM (+rSRq)

6 Hmmm, a common thing in IE, like when it used to ignore the lack of a /table tag, allowing bad HTML to display, while stricter browsers like Netscape wouldn't render the unclosed table.  I would tell webmasters that their HTML was faulty, and they'd say "What do you mean?  It works in Explorer."  Fault-tolerance makes fault the standard.

Posted by: Mauser at October 08, 2013 02:25 AM (TJ7ih)

7 IE would have to replace the colons.  Those are reserved characters in two ways:  both as drive letter indicators, which is probably not relevant here, but also as alternate data stream indicators.

Posted by: RickC at October 08, 2013 04:43 AM (swpgw)

8 Nice feature update!  Thank you!

Posted by: Tom Tjarks at October 08, 2013 10:14 AM (T5fuR)

Hide Comments | Add Comment

Enclose all spoilers in spoiler tags:
      [spoiler]your spoiler here[/spoiler]
Spoilers which are not properly tagged will be ruthlessly deleted on sight.
Also, I hate unsolicited suggestions and advice. (Even when you think you're being funny.)

At Chizumatic, we take pride in being incomplete, incorrect, inconsistent, and unfair. We do all of them deliberately.

How to put links in your comment

Comments are disabled. Post is locked.
10kb generated in CPU 0.01, elapsed 0.0137 seconds.
20 queries taking 0.0087 seconds, 25 records returned.
Powered by Minx 1.1.6c-pink.