AROS World Exec

Distros => Icaros Desktop => Topic started by: miker1264 on October 18, 2019, 08:44:02 PM

Title: New MultiView
Post by: miker1264 on October 18, 2019, 08:44:02 PM
This is not another one of my Viewer programs...

Actually, this is Icaros Desktop 64bit Unofficial MultiView.

I enabled Save As to save picture files using picture datatypes.
It can Save As as you can see, but it can't yet Save As IFF. (I'm working on that.)
Now I can use Save As to test the save functions for Picture Datatypes.

Now I will move my BMP, PCX and TGA datatypes to Icaros x86-64 to continue testing.
Now that I have a modified MultiView to test with I can start working on Save ILBM. ;-)

Hopefully, soon MultiView will be able to Save As IFF. How long has AROS waited for this?
Title: Re: New MultiView
Post by: Amiwell on October 18, 2019, 11:29:46 PM
really nice miker :D
Title: Re: New MultiView
Post by: Amiwell on October 18, 2019, 11:55:59 PM
miker if I compile with the procedure described by paolone it will work in its alpha distribution?
Title: Re: New MultiView
Post by: miker1264 on October 19, 2019, 12:07:23 PM
miker if I compile with the procedure described by paolone it will work in its alpha distribution?

How do you mean? Using the VMWare Virtual Machine that is provided for the build system you can build AROS including MultiView.

I haven't committed any changes to MultiView. I'm just using it for testing for the moment but if it works well and people like it maybe it can be part of MultiView in future.

I'm thinking about adding Save As PNG for Picture DataTypes and splitting About Box into About MultiView and Picture Information. I'm also working on Save ILBM for ILBM DataType. All those things should make MultiView better than it is in my opinion. I might change the icon slightly so we know it was modified with some added features.

What I do won't break compatibility because I'm just adding some menu items and one or two new functions such as "DoWriteMethod_PNG" and "Picture_Information". Other than that it's the same as it was. It still works the same.
Title: Re: New MultiView
Post by: Yanosh on October 19, 2019, 01:14:34 PM
It would be nice if "fit to windows" was the standard way to show the pictures.
Title: Re: New MultiView
Post by: miker1264 on October 19, 2019, 02:08:58 PM
It would be nice if "fit to windows" was the standard way to show the pictures.

That's a good point. Currently I believe if the picture is too big for the viewing area scrollbars are added. Fit to Window with the window being the max viewing size might be better as default. Maybe use MultiView Prefs.
Title: Re: New MultiView
Post by: paolone on October 21, 2019, 08:29:08 AM
It would be nice if "fit to windows" was the standard way to show the pictures.


Since Miker already agreed... here's my +2 from me!
Title: Re: New MultiView
Post by: miker1264 on October 21, 2019, 07:38:24 PM
The modification to MultiView works well enough with Fit_To_Window as the default setting. But I have to disable Fit_To_Window now.
However, the way it should work is that if the image is larger than the display area it should be resized. But if it's smaller, don't resize.

Still working on Save As PNG, but it's not as easy as you might think. I'll work on the resize if oversized functionality as well to make it work.
Maybe it would be better to add another menu checkit item "Resize Image" which will resize if oversized. That is the desired effect we want.
Fit_To_Window is actually intended to be used when resizing an image in a window using the resize gadget at the window's lower left corner.

As an added benefit using Save As PNG, I'm hoping that we can resize with Fit_To_Window then save. That is a quick way to resize images!
Title: Re: New MultiView
Post by: miker1264 on October 21, 2019, 09:37:35 PM
As far as Save As PNG I'm making progress in that direction. Notice that Clown4.png has 33 bytes.

In the Hex Editor that represents the PNG signature, the IHDR and 4 trailing bytes. The original PNG
image is shown in the Hex Editor below that for comparison. It only has 33 bytes because I only copied
the bmhd data from the MultiView dto (datatype object) to the ndto (new datatype object - png). The
next step is to copy data from the bitplanes of dto bitmap directly to bitplanes of ndto which should
result in adding the IDAT and IEND to the PNG file. Then MultiView will have saved a new PNG file!

Success! Now MultiView can Save 24bit PNG. So next I'll expand it to other bitdepths as well. :-)

Here is the 64bit binary for MultiView that can save PNG. Open 24bit jpeg, pnm, png or bmp file.
Choose Save As PNG then select a location to save and change the file extension to .png to save a file.

Note: It currently only works with 24bit RGB picture files! It won't work yet with other bitdepths.
Title: Re: New MultiView
Post by: paolone on October 22, 2019, 02:35:14 AM
Great!


Should I add your new binary to Icaros 64, is the current PNG datatype good, or shall I update it as well?
Title: Re: New MultiView
Post by: miker1264 on October 22, 2019, 08:16:32 AM
Great!


Should I add your new binary to hIcaros 64, is the current PNG datatype good, or shall I update it as well?

No. Not yet.
The MultiView 64bit binary is just a sample. It's not done yet. Maybe in a few more days. The png datatype is unchanged. The bmp datatype was modified but it only currently saves bmps on 32bit. It doesn't work on 64bit.

When the save function is finished in a few days what should we call it - "the debut of MultiView2 capable of saving using picture datatypes"?

Rename your 64bit MultiView. Copy this one to its location and try it for saving 24bit png.
Title: Re: New MultiView
Post by: miker1264 on October 22, 2019, 12:07:16 PM
@paolone

Some ideas have been presented for "New MultiView" that include Image Resize as default, showing Datatypes List, saving DT List to file, separating About Box and Picture Information in addition to some cosmetic changes as far as how information is displayed. Being able to Save Settings is an added benefit.

I chose to include Save As PNG because most modern graphics programs support PNG but few support ILBM. It also now gives us a quick way to convert between ILBM and PNG, or other types and PNG. That makes it more useful to users.

I haven't yet explored how it interacts with IFF Icons and PNG Icons. But if it can display the icon images for both ilbm and png then we can save both types of icon images quite easily as well.

Being able to Save As PNG opens up an entirely new way of using MultiView!

In a related development as far as Picture Files it has also been proposed to integrate the functionality of picture requester with Wanderer to allow a third view mode called "Tile View" (thumbnails). Using Tile View we can quickly view the shiny new PNG and IFF files that the New MultiView will be producing.
Title: Re: New MultiView
Post by: Yanosh on October 22, 2019, 02:19:18 PM
I don't know how much work this would need, but it would be nice to have a little gui with few buttons, like "fit to window" or "full size" and "+" and "-" for zoom in and zoom out. Maybe add a keyword for "fit to window"? Is this too much?
Title: Re: New MultiView
Post by: miker1264 on October 22, 2019, 02:51:58 PM
I don't know how much work this would need, but it would be nice to have a little gui with few buttons, like "fit to window" or "full size" and "+" and "-" for zoom in and zoom out. Maybe add a keyword for "fit to window"? Is this too much?

Fit_To_Window is there under Picture Menu. It is for Resizing the window. I'd like to add Resize Image as default when opening oversized images the will be resized to fit.
Title: Re: New MultiView
Post by: miker1264 on October 23, 2019, 08:13:23 PM
MultiView 64bit doesn't show oversized 32bit PNG images well after being resized. But when I use MultiView to Save the 32bit PNG file to RamDisk is appears just fine. (Yes. MultiView can now Save As PNG, 24bit & 32bit).  :-)

The DoScaleMethod works fine for MultiView 32bit, but as you can see it does not display correctly for 64bit. But this same image saves just fine with current size.
Title: Re: New MultiView
Post by: miker1264 on October 23, 2019, 08:18:19 PM
Here's the 32bit PNG file that I saved using MultiView x64.
You can see it's not purple, and it has Alpha Transparency.
Title: Re: New MultiView
Post by: paolone on October 24, 2019, 10:04:43 AM
Great!
Title: Re: New MultiView
Post by: miker1264 on October 24, 2019, 11:40:11 AM
Great!

The good news is that my new function Save As PNG is working well on MultiView 64bit.

The bad news is that the existing MultiView 64bit has serious issues that causes it to crash horribly bringing down the entire system! I've asked for some assistance from developers. We'll see if anyone offers. If so it may take a few days to narrow down the issues as far as Intuition, Dos, Exec or just isolated to MultiView and datatypes system. If I fix these issues on my own it may take a few weeks. I'll have to do a lot of research.

Of course I could just add my PNG function and leave it the way it is now. That would be bad. :-(

Update: The 'Open' menu item error that caused MultiView 64bit to crash the system has been successfully resolved. I'm pleased with that outcome.
There are still some issues but I'm working through them and finishing up Save As PNG by adding support for saving 8bit PNG files. It now saves 24bit & 32bit.
Title: Re: New MultiView
Post by: miker1264 on October 25, 2019, 12:58:33 AM
Here's how I went about fixing the Open Error...Read the text file if you'd like to know.

There is another issue when an oversized PNG image is opened and we choose 'Fit_To_Window' on the Picture Menu. It gets rescaled and when it is displayed it turns purple! That's because the RGB components get scrambled around for some reason that only affects the display. The datatype object that has been sized is fine and it saves correclty. So the easy solution would be to close the original window without closing the dto and keeping the filename then open a new window.

/From WinCleanup();
KillWindow();
KillMenus();
KillGadgets();
FreeVisual();
//CloseDTO();
KillICObjects();
KillFont();
Setup(filename);
Title: Re: New MultiView
Post by: miker1264 on October 26, 2019, 10:10:19 PM
I have solutions for the two remaining redraw issues for MultiView 64bit. When using resize gadget on a MultiView window on Icaros 64bit MultiView will crash bringing down the system. The solution is to remove the size gadget and instead have two resize methods which are Zoom and Fit Width menu items. Zoom In / Zoom Out can use the menu or keyboard input. Fit Width will use a Numeric Input Box. The new size will be calculated by aspect and the image gets resized.

Zoom In / Zoom Out already works I'll just need to find some good zoom levels. Fit Width should work also based on user input and aspect ratio.

The second issue is "Purple PNG" that is a redraw issue that happens when a png mage is loaded that is larger than the display area. When "Fit_To_Window" is selected the image gets resized correctly to fit but it turns purple.

The window containing the original image gets resized and the new image is forced into the old window. The solution is to completely close the window and open a new window at the appropriate size. The image will then resize correctly.

Update: Save As PNG now works correctly to save 8bit or less (ILBM) as 8bit PNG. It can also save 24bit and 32bit PNG files.
Title: Re: New MultiView
Post by: miker1264 on November 10, 2019, 11:17:28 AM
New MultiView can now Save As PNG for 8bit, 24bit and 32bit. There is still some work to do to correct a few minor issues.
Title: Re: New MultiView
Post by: aurabin on November 10, 2019, 11:45:50 AM
Thank you ... great Job!
Title: Re: New MultiView
Post by: miker1264 on November 10, 2019, 12:36:24 PM
Thank you ... great Job!

No problem! MultiView for 64bit wasn't working correctly. In fact, in some cases it crashed the system. So I decided to fix the major issues and add some functions.

The next major goal after a few fixes is to focus on the ILBM datatype by adding Save Functions so that MultiView Save As IFF will also work as expected.

So what will be New in New MultiView? The most noticeable changes will be Save As IFF, Save As PNG and that About and Picture Information are now separate menu items. Image type detection especially for ILBM, HAM, EHB and standard 8bit will be updated. There is also a possibility of adding "DataTypes List" functions to MultiView and the ability to save a "DataTypes List" to file. It is interesting to note that you can open a picture such as ilbm that is less than 8bit and save as png. The picture will automatically be up-converted to save as 8bit png! That's nice.

Those are just a few updates. More may be added later to make MultiView more modern and more functional. These changes are being made with the goal of keeping compatibility with 32bit and other AROS  flavors such as AROS 68k.
Title: Re: New MultiView
Post by: Amiwell on November 10, 2019, 01:48:31 PM
good miker :D
Title: Re: New MultiView
Post by: miker1264 on November 29, 2019, 11:46:16 PM
Making a few minor changes to MultiView for 64bit to open and display picture files correctly.
Title: Re: New MultiView
Post by: Amiwell on November 30, 2019, 04:50:37 AM
I hope there's a version for x86 miker :D
Title: Re: New MultiView
Post by: miker1264 on November 30, 2019, 10:05:06 AM
It will be the same version for x86 and x64. I believe AROS 68k uses the same version also.

It was stable enough when working on 32bit. But MultiView itself is incomplete. If you open a pic and choose "Nomal" on the "Window" menu then you'll see what I mean by it being incomplete.

Though the 32bit version was stable the 64bit version was Very Unstable! When using "Open" on the Project Menu it would crash horribly by trying to force the new image into the existing window. There was a resource sharing error. So I solved that major issue by closing the window and then opening a new window with the new image. Nice.

Resizing with the resize gadget caused the same horrible crash. Also using FitToWindow and KeepAspect it would Maximize the image but it wouldn't size the window frame. So there would be a large gap on the right or bottom. That works now with a new Resize function but there are still some minor issues to fix and some improvement.

When I decided to add Save As PNG which works now I didn't know I would have to fix so many things! I thought MultiView was feature complete. I suspect that is true for many AROS components. They seem to work well until you look at it and test it. Then you will discover problems and inconsistencies. That accounts for some of the frustration that paolone and others have when trying to update old components for use with x64. It used to work on 32bit but it won't work on 64bit.
Title: Re: New MultiView
Post by: Amiwell on December 07, 2019, 06:47:37 AM
i understand miker
Title: Re: New MultiView
Post by: miker1264 on December 12, 2019, 11:39:31 AM
There are still some minor issues but I have fixed the main issues that caused MultiView to crash on 64bit. This is the version that I'll commit at the moment. I'll try to fix the other issues when I can.

I'll post the compiled 64bit version later today if anyone wants to test it out and compare the new one with the original. These changes only affect 64bit and 68k.

BTW MultiView can now Save As PNG. :-)
Title: Re: New MultiView
Post by: Amiwell on December 12, 2019, 03:12:44 PM
ok miker
Title: Re: New MultiView
Post by: miker1264 on December 12, 2019, 07:36:49 PM
ok miker

It's really difficult to read the titles of the most recent topics. So I apologize in advance if I miss anyone's posts. Aros-Exec isn't working right for me.
Title: Re: New MultiView
Post by: miker1264 on December 12, 2019, 08:40:54 PM
Here is the newest version of AROS MultiView that I'm working on.

Please Note: This is the 64bit version so it WON'T WORK on Icaros Desktop 32bit (ABIv0).

Before renaming your current MultiView to copy the new one over for testing try this...Double click to open a picture file with MultiView 64bit. Once it is showing in a window choose from the MultiView menu "Open" and see what happens. Then rename the older MultiView and copy the new one to the same location. Try the same experiment and compare. Also try the new "Save As PNG".

Let me know what you think of the newer version and if there are any ideas about useful features for MultiView.
Title: Re: New MultiView
Post by: Amiwell on December 14, 2019, 09:40:04 AM
thanks for your effort :D
Title: Re: New MultiView
Post by: miker1264 on December 14, 2019, 07:21:03 PM
thanks for your effort :D

When I get a chance to commit the changes for New MultiView for ABIv1 sources, then I will also post it on AROS Archives so that everyone can use it for 64bit.

The current version of MultiView for 64bit (ABIv1) will crash when using "Open" from the menu after double-clicking to open the first image. That's a big problem! That issue has been resolved and I added "Save As PNG". Soon it will be possible to "Save As" any other supported picture datatype using the New MultiView. ;-)