Image Lister / Browser stack
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Image Lister / Browser stack
I wanted to see every image ID that gets used by or is reserved by the IDE, so I made this tool stack that can generate a list of IDs in a given range, resolves the chunk/path to the image, and displays a 128x128px preview of the image that's selected from the list. Not as straight forward as one might think. You can also scan for images of a non-srciptOnly mainstacks from the pop-up menu. You can use the arrow-keys to scroll through the list of images, which is interesting because some are ordered frames of an animated sequences.
Plenty of room to make it more robust, do more like scan any substacks of stacks.
Plenty of room to make it more robust, do more like scan any substacks of stacks.
- richmond62
- Posts: 5226
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Image Lister / Browser stack
Isn't there a risk, because you confine yourself to a given range, that you'll miss some images?a list of IDs in a given range
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Image Lister / Browser stack
I was, at least initially, only interested in certain ranges of Image IDs because they're reserved by the IDE and I'm interested in possibly making changes to some or maybe adding a few into any empty slots (like 'smooth' versions of the 'brushes' images) but in order to do that I first need to know if there are any empty 'ID' slots in a particular range.richmond62 wrote: ↑Mon Jul 08, 2024 5:09 pmIsn't there a risk, because you confine yourself to a given range, that you'll miss some images?a list of IDs in a given range
I added the 'scan selected stack' for images popup menu as an after-thought. That listing method certainly could be more robust. It currently does NOT look into substacks, so that listing certainly will miss any images that are in any substacks of a stack.
- richmond62
- Posts: 5226
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Image Lister / Browser stack
One of the limitations of the FIND stack is that it cannot perform an object search:
-
-
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 5226
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Image Lister / Browser stack
To access details of resources in substacks you will have to open them all so you can search in them.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 5226
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Image Lister / Browser stack
-
- Attachments
-
- Test.livecode.zip
- (102.91 KiB) Downloaded 281 times
-
- Object Search.livecode.zip
- (6.59 KiB) Downloaded 274 times
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Image Lister / Browser stack
I made a few changes to the original stack, including looking inside substacks of stacks in the stack image lister method.
I kept getting what appeared to be image corruption, but only with certain index color GIF lz compressed images or certain SVG data compiled and placed into an image control. But then manually placing the very same images they looked fine. So I thought that maybe it's my method of copying the data of an image to into a new image and resizing to 128x128px preview. Then I found the syntax 'prepare image tMyImage' which was introduced in 6.0 engine. Using that syntax loads the image into memory first which decompresses and subsequently renders these images properly.
I kept getting what appeared to be image corruption, but only with certain index color GIF lz compressed images or certain SVG data compiled and placed into an image control. But then manually placing the very same images they looked fine. So I thought that maybe it's my method of copying the data of an image to into a new image and resizing to 128x128px preview. Then I found the syntax 'prepare image tMyImage' which was introduced in 6.0 engine. Using that syntax loads the image into memory first which decompresses and subsequently renders these images properly.
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Image Lister / Browser stack
It's a bit more tricky than I'd imagined it should be to get image data from image controls for several reasons:
1) the data can be formats such as RLE encoded bitmap or netPBM that aren't natively supported on the web.
2) the image data may come from an URL or external file, which may be a relative path that could be relative to the stack file the image control is in and that needs to be considered when resolving the path to the image file into a full path.
3) The image may actually only contain an ID number of an Image in a stack or image library in memory. which needs to be resolved.
4) the image data may be in revDrawingLibrary's proprietary 'compiled SVG' binary format which as far as I know cannot be converted back into normal SVG data, so those must be exported to snapshot as PNG (best for retaining transparency in images).
I had 'rolled my own' previously for checking image formats by reading the first few bytes and checking for 'magic-numbers' such as 'GIF87a', but that doesn't help with RLE or 'SVG-compiled' image data.
'The paintCompression' keyword was very useful this time for checking the file-format of image data.
Here's a breakdown of values:
1) If the image data is 'compiled SVG' format then getting the image's paintCompression value returns 'pict' (which kind of makes sense since 'PICT' from classic MacOS supported 'MacDraw' vector art)
2) If the images paintCompression is 'rle' compressed format then it's probably an ancient MetaCard Icon, but the point is it would need to be converted to a compatible graphics format for use on the web.
3) the rest are what you might expect 'gif','png','jpeg', all web friendly formats so no conversion is needed.
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Image Lister / Browser stack
It's weird, I have a few test 'images' with SVG compiled data in them that do not want to display in a browser after the conversion for some reason.
Like this one doesn't show up in Safari for me:
Ooooh now I see, its probably the /slashes/ in the base64encoded data, a no-no for URLs. Normally you wouldn't paste these DataURIs into a web browsers address bar (although it does seem to work for most images.
But maybe not, it shows up in Chrome on darkmode so I'm thinking it has to do with this particular image being light and then on white background and also having transparency to it.
Like this one doesn't show up in Safari for me:
Code: Select all
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFMAAABNCAYAAADabljrAAAABGdBTUEAALGPC/xhBQAADB5JREFUeJztnO1vHFcVxn/j9dpex83Sxq3rpHVK0pYgSGldUFWoEFERIJXyoa1QBRTlA4jXP4dX8a0ChBDiA+9U0PCSEEWNXJWAFGgMqZOQpnVSNom9SfwyfHjO4Y7XO7MzO2s7TvNIo53dnbn33Oeee86Zc+8duImbuIkbHNFGC5CFOI5HW3+Lomh2I2TJgw0nM47jcWAUqNtPqwjMgBPbAGajKDrbS9mKYt3JjOO4jghzElsxAFSBCjDU5v8rwBKwAFxr8/9ZRPJsFEWNXsicF+tCZhzHVWA3MAEMJ/4aAmrAlsR5UTQRwXOJc8c8MANMR1G00EXZhbCmZCZI3I20DUTYrWhYD7TccjFx3mj5fWviez1xnvwdpK0N4C1ELkiLp1ljUteEzBQSb0NDO0ngHCLqPCuJLIqtwDb73JL4/Roa9hfs+5qS2nMy4zjeDewh2L077Oi3S94kaM5ir+sHBhGpdeB2+20ReMMOt7fHoiia6WXFPSPTtHEvsosgTdmBGgci8TRwtVd15sAg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T7729/ZVtbblr3fp19Aecnn0ZTF9fP2GEeb9xo9iqZR/c0Gi5QntSicRM9BnEdJ6sP2fYbr7b1GSVjo5HM/w2i64HGCh15EQ9XnqXsNn2XsI5DYBH5vxzzX+xu3kkh5F9wHgU8RNBVEpi9kKGsLPUmRbNN54Gdo6x9stnfBJZFC6gR6tn+IlcSCyHVtTZLrGXKQzFGbc8d5lNY7RFijvnnfUtiKjPdnjqLgfw/azN/N7OUMmss+bkdyPvvGeX9mOyTe7Opvd23F7YQ97ne3+f8UImmW9qvWbuw3u2ahzTuH6+RbH+9zO/B2fedwEWy2t2HfxE3cxA2P/wH+pe0BBMfa3wAAAABJRU5ErkJggg==
But maybe not, it shows up in Chrome on darkmode so I'm thinking it has to do with this particular image being light and then on white background and also having transparency to it.
- OpenXTalkPaul
- Posts: 2793
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Image Lister / Browser stack
Added a button to wrap the dataURI in a HTML container easier for testing and probably for future use as part of a larger export mechanism.
Who is online
Users browsing this forum: No registered users and 3 guests