wbOmnibus Extender - Dialog and Image

Started by JTaylor, June 05, 2024, 09:19:55 AM

Previous topic - Next topic

JTaylor

I have added the ability to display images, other than bitmaps, to dialogs. I have added this to the Dialog and Image Extender.  Please read the help.  There are quirks.

    imDisplayImg()

    http://www.jtdata.com/anonymous/wbOmnibus.zip

Jim

kdmoyers

buglet: in the helpfile for snRegEx , the declaration at top leaves out the Action parameter
The mind is everything; What you think, you become.

JTaylor


PaulSamuelson

I started using imDisplay() last week. I like it because it loads faster than system viewers. I do not need the info, but it doesn't bother me that it is there.

I found a bug relating to zooming in and out. After you have zoomed into an image, if you attempt to zoom out beyond the original size, it crashes. Obviously, you cannot display beyond the edges of the image, but if there is a way to limit zooming to that point, it would avoid the crash.

Thanks!

JTaylor


JTaylor

How are you zooming in and out?  I cannot reproduce.

Jim

PaulSamuelson

I am zooming with the mouse wheel.

I think it has something to do with the image size. It works correctly on 11 MP images (2747 x 4135), but fails on 20 MP (5568 x 3712).

PaulSamuelson

It fails when trying to open larger images


JTaylor

Thanks for the info.  I will see if I can resolve that issue.

Jim

JTaylor

Do you have a link to a large image like the ones you mention?   I can find large width x height but not in file size.

I didn't encounter the problem a couple of times but can't reproduce consistently.

Not sure if I can make the info go away.  If I do you lose zoom and it doesn't size automatically.  I could do the resize math, of course, but didn't know if the loss would be worth the gain.


Jim

JTaylor

I have posted an update.  Not sure it will fix the zoom issue when grid info is displayed but it does make the "display_info" option work, which should solve the zoom issue, if you don't display grid info, as it uses a different method for display. 

Also, you can now submit a TAB delimited list of file names rather than repeatedly calling the Function.   This make the display much smoother, especially when grid info is not displayed.

  http://www.jtdata.com/anonymous/wbOmnibus.zip

PaulSamuelson

It is still acting the same (including showing info, whether marked true or false).

Here are a couple of large images for testing.

https://www.dropbox.com/scl/fi/d5rrtnvdebv3hll8cmn8s/LargeImages.zip?rlkey=83t57kxcbjcnfr6oafoi833nb&dl=0

Thanks,

Paul

JTaylor

Hmmmmmmmmm....I can't reproduce, even with those images.

Just to make sure we are on the same page...you are using "wbOmniIMG.dll" for AddExtender()?

Jim

PaulSamuelson

Sorry, I was using wbOmnibus.dll, but I see that it hasn't been updated since 5/26.

Now, using wbOmniIMG.dll, with info @false: images open in the same location (which is nice), there is no zooming (and thus no crashing), but portrait images are stretched to be displayed landscape. Landscape images display correctly. Very large images (4000 x 6000) crash with a memory error.

With info @True, zoom-in works, but zoom-out crashes when you get past 100%.

JTaylor

I posted another update.  It should fix the title on multiple submissions.  Make the vertical images display appropriately and stop the info=@TRUE images stop moving around.  I got bold and altered the library I am using :-)

I will keep trying to reproduce the problem you are having.  Your images have worked fine for me so far.  What OS are you running?  Want to make sure I am doing all I can to match your situation.

Thanks for the feedback and sorry for the hassle.

http://www.jtdata.com/anonymous/wbOmnibus.zip

Jim

PaulSamuelson

Quote from: JTaylor on June 10, 2024, 02:42:21 PMWhat OS are you running?


I think that's it. It fails with Win10 22H2, but works correctly on Win11.

JTaylor

Okay.  I will try on 11.   I am running Win10 22H2 and it works there.   If it fails on Win11 for me then I must live in bizarro world and everything is the opposite :-)

Jim

JTaylor

Still no joy on reproducing the problem but I haven't given up.

If you want to give my latest project a try and see if it works better for you there is a another extender named:

wbOmniGUI.dll

It should be considered beta, at best.  I am having a weird problem but it all revolves around images I may have altered, so not sure if it is an issue or not.  Other than that I am pleased with its performance.  It presents itself by skipping the images.

There is only one function: guiDisplayImg()

The Help File section is named "GUI"

http://www.jtdata.com/anonymous/wbOmnibus.zip

Jim


JTaylor

I am not sure what to do here.  I think I saw what you are mentioning once or twice sometime back but I cannot reproduce it on Win10 or Win11.   Also, I haven't ever encountered the memory error.  I have included the images you posted as part of the testing. 

Open to suggestions from anyone on how I might track down the issue.

Curious if the wbOmniGUI Extender worked???   I was looking at ImGUI and thought, WOW, I could do some cool stuff with that.  Once I finally got it integrated in an Extender I tried to think of what I could do that would be useful and then couldn't think of anything :-)    I then thought about this problem and decided to try solving the Image display problem.

If anyone has any suggestions for ImGui, let me know.   I think it would mainly be a display tool, from my experience so far.

Jim

PaulSamuelson

I tried the OmniGUI, but get an error:
Assertion failed!
Line 2560
Expression: (0) && "Could not load font file!"

JTaylor

Sorry about that.  Forgot I was experimenting with Fonts.

If you want to keep trying I did post an update.  Hopefully this one won't be a waste of your time.

http://www.jtdata.com/anonymous/wbOmnibus.zip

PaulSamuelson

I like the concept. It would be nice to turn off the info at the top. I'm not sure I like that left/right up/down closes the window when getting to the end of the list. The window unexpectedly closes if you don't know how many images there are (or which one you are on). I think using right/left up/down to scan through images, but ENTER or ESC to close the window would be more intuitive.

I am having trouble with your window size. Since there is no zoom, I would like to display the image as large as possible, with the correct aspect ratio. My idea was to create a window, no larger than monitor dimensions - 100, placed '50 50' from the top left (centering on the long dimension).

I think the following code should do that, but the image ends up taller than the window, so it scrolls vertically. Maybe something to do with the title bar and info at the top?

Thanks,

Paul

OmniGUIExtender = DirScript():"wbOmniGUI.dll"
AddExtender(OmniGUIExtender)

file1 = "C:\DV000223a_GS.jpg"
file2 = "C:\DV000223b_GS.jpg"
fileList = file1:@tab:file2

monitorW = winMetrics(0)
monitorH = winMetrics(1)
monitorRatio = (monitorW - 100.0) / (monitorH - 100.0)

jpgW = 2747.0
jpgH = 4135.0
jpgRatio = jpgW / jpgH

if monitorRatio > jpgRatio ; image too tall
  imageH = int(monitorH - 100)
  imageW = int(imageH * jpgRatio)
else ; image too wide
  imageW = int(monitorW - 100)
  imageH = int(imageW / jpgRatio)
end if

windowSize = "0 0 ":imageW:" ":imageH
displaySize = imageW:' ':imageH

GuiDisplayImg(FileList,windowSize ,"0 0", displaySize,0,"Title")

JTaylor

Update posted.  Rather than explain the changes here, please read the Help file.  I think I covered all of your issues and requests in some form and added a thing or two.  Just let me know if anything needs some tweaking. 

http://www.jtdata.com/anonymous/wbOmnibus.zip

Jim

PaulSamuelson

Jim,

I like the new features and have some comments:

I tried very-large (4000 x 6000) images with no problems.

The window is always named "Hello World".

I like that you have a "fit" option for the picSize (that way I don't have to do my own math). Could you do the same with WinSize (assuming PicPosition of '0 0')?

Can the numeric keypad ENTER also close the window?

Is it possible for the zoom to move faster? And is it possible for the zoom to center at the mouse point (like you have in imDisplay)?

I feel like I am asking too much. Sorry.

One concern I have is an image was deleted while using the extension. I was playing with various parameters (I don't know exactly which ones at the time) and it wouldn't display at all after a few tries. I eventually figured out my image was gone. Do you read the image once and keep it in memory? I may have had the image open multiple times.


-Paul


JTaylor

Let me know if zoom speed is good.  You can set that now in the function.  If you think it still needs adjustment try various speeds and let me know what you think a good default would be. The way I am doing it is adding/subtracting pixels for each step.  This release sets it at 50, as the default, at the moment.  I will adjust the default to whatever you think is best.

Title issue is fixed.  See the Help.

To make sure we are on the same page...when you want a "fit" option for the WinSize, do you mean just make it fullscreen?

Keypad stuff is adjusted.  Will work with NumLock on or off.

Images are loaded every time.   If File doesn't exist it should just quietly move to the next one.  If you see this as a problem I can provided an option where it will notify you if an image is missing.  When I did this I tried to think if a warning would be good but figured most people would be loading images dynamically and the chance of images going missing in the middle of viewing would be unlikely.

http://www.jtdata.com/anonymous/wbOmnibus.zip

Jim

PaulSamuelson

I like the zoom speed and I like that it is now adjustable. Your default of 50 seems about right. The only issue with the zoom now is since it is zooming from the top right corner, there is no way to zoom in on the bottom right - it just gets pushed out of the frame. If you can zoom towards the mouse pointer position, it would solve that.

I like the Filename title option.

For WinSize, like PicSize, since you know the image dimensions, can you make the window the same size? That would eliminate the extra black box behind. Is there a reason for the WinSize black box behind the floating window? It doesn't seem to do anything, since only one image window is displayed at a time.

I have not had any more issues with images disappearing. In my use case, I will know if an image is available before displaying it, so a not-found message is not needed. In other use cases it might be helpful. I am hoping this will be used by others as well...

I appreciate your time and effort on this!

-Paul



JTaylor

Sounds good on zoom speed.   I am working on Zoom to keep it in frame, as you requested.  It is a bit tricky or I am just dense :-)  I have gotten it to sort of stay like you want but not as good as it needs to be.

That should be doable on the WinSize.   I did add a fullscreen winsize option.

Assuming I haven't missed something.  The back window is required as it hosts the ImGui window.  It is like the window that opens and is minized to the tray when you open a WinBatch Dialog.  Wonder if I can hide that.  Probably will be an option, if I can, as it is nice for slide shows.  I can, at the very least, size it with the ImGui window.

jim

PaulSamuelson

When you use "Filename" for the title with an image list, the info from the first file is shown for all images.

JTaylor

The Filename problem was me being an idiot.

Jim