Image Library thumbnails bug

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Image Library thumbnails bug

Post by gyroscope » Mon Jun 09, 2008 12:38 am

Hi, I thought I'd get this one out of my hair (what's left of it! :wink: )

This prob/bug has happened since from the first time I opened Rev, as far as I can remember:

(On a Mac), bringing in jpegs or pngs into the Images Library, it sometimes (more often than not, it seems) puts a totally irrelevant image as a thumbnail. Some favourites which keep popping up are: a white background with the words "using <" repeated twice, one under the other; a thin grey line; a filled box with a grey gradient; little arrows in boxes, etc. In other words, the thumbnail bears no relationship at all to the actual image imported. (I've just tried again as a test, and this time most worryingly, there is no thumbnail at all - you can select the empty rectangle and still place the actual image though). :?

Is this a known bug, does anyone know please; and does this happen in Rev on Windows :?:

While on this subject, hopefully I can help some others new to Rev, who might be confused about certain Image Library behaviour (as I was, it caused quite a bit of hassle at the beginning for me until I realised what was going on): if you import an image and then delete it from your card, the thumbnail stays there in the Image Library, until you click on it or close the Library, and then it goes.

So basically, you can't import thirty pics and decide which ones you want before deleting them, for the simple reason that each image is placed on the active card at the moment its imported + if this image on the card is deleted, the particular image in the library is also deleted (um, eventually :wink:..). Anyhow, hope that helps someone, sometime.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jun 09, 2008 2:23 am

Gyro,

Bugs don't belong under "Getting started...".

If you make sure to use unique ID numbers, you'll be fine.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Mon Jun 09, 2008 9:41 am

Hi Mark, thanks for your reply...
Bugs don't belong under "Getting started...".
I guess I should have put a question mark after the post title, as I wasn't completely certain it was a bug (thought perhaps I'd corrupted my copy of Rev somehow, for instance); I was after some sort of confirmation.

There doesn't seem to be a main heading or heading description in the Rev Forum that I can see, which mentions the word "Bug" or "Bugs" so I'm at a loss to know where this post should have been placed.
If you make sure to use unique ID numbers, you'll be fine.
Unfortunately I couldn't get that to work. I tried changing the id numbers in the Inspector but that didn't affect the incorrect thumbnails; nor was I able to find out if its possible to give an image its id number before its imported...also I was under the impression that if you create a new stack in a freshly opened Rev that it automatically gives the images unique numbers anyhow? A bit confused there! :?

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Post by BvG » Mon Jun 09, 2008 1:23 pm

This is a problem of both scope and the IDE being made of native rev stacks, as well as the fact that icons of buttons can only be referenced by a number, describing an ID.

The ID of an image always will be evaluated based on the message path, and if not found there, based on a, to me, unknown way (maybe first stack loaded?). The "library" is just a collection of images, referenced by button icons in a stack. That reference can point to another image, and there's quite a few images in the IDE. So the images you see are some images somewhere in the IDE. As duplicating a stack or an image will set the relevant ID's to some more or less random value, it's highly likely that at some point the reference points to a wrong image, which is what you see.

One could argue that this is a kind of bug, but not of the "wrongly coded" kind, but of the "strange inconsequence produced by the way things are made" kind.

As for using ID's, it's most often easiest to not delete stuff based on ID, but on name, which you can make sure of that they'll never change. Bonus points for deleting stuff with a longer description like:

Code: Select all

delete image "my own made up name" of group "a group i know" of stack "my own stack"
Said all that I never use the image library stack, because I see no use for a list of all Images in a stack. If I have so many images in a stack that I need that, I normally make a card containing them all within a scrolling group, and thusly make sure I have them all in one place.

edit: fixing code tag
Last edited by BvG on Mon Jun 09, 2008 2:11 pm, edited 1 time in total.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Mon Jun 09, 2008 1:56 pm

Hi gyroscope and BvG,

I agree with BvG that this isn't a real bug, but maybe this is a series of very tiny bugs as well as a consequence of the approach followed by RunRev.

Contrary to BvG, I do use the Image Library, once in a while. If I import something into the library, I import the picture into a stack, first. I change the ID if necessary and then import it into the library.

I prefer to make my own libraries from scratch, though. To do this, I take a bunch of pictures, e.g. an icon family, and import them all into the first card of a new stack. Then I write a script to set the icons of the pictures to something unique, e.g.

Code: Select all

on mouseUp
  repeat with x = 1 to number of images
    set the id of img x to (23000 + x)
  end repeat
end mouseUp
Finally, I set the name of the stack to something like "revLibMy Library Name". I save the stack as "revLibMy Library Name.rev" and copy it to ..../documents/my revolution enterprise/Resources/Icon Libraries/revLibMy Library Name.rev" Next time when I start Revolution, the library appears in the Image library.

Note that big libraries may take up a lot of memory. It is probably not wise to import your entire photo collection, for example.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

gyroscope
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 404
Joined: Tue Jan 08, 2008 3:44 pm
Contact:

Post by gyroscope » Mon Jun 09, 2008 10:03 pm

Hi BvG, thanks for that comprehensive explanation; I understand what's happening there now.

Hi Mark, thanks also for your info and neat bit of code. You've saved the day once again! :) Import as control + changing ids then, seems the better way to go, concerning images, if I understand you correctly.

:)

Garrett
Posts: 386
Joined: Sat Apr 08, 2006 8:15 am
Contact:

Post by Garrett » Tue Jun 10, 2008 8:27 pm

I ran into this same problem. I thought it was something wrong with my images that this happened to.

Post Reply