Newest MultiView

miker1264 · 7076

miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #15 on: November 18, 2021, 04:37:18 PM
Important observation!  8)

The beauty of MultiView is in its simplicity.

So why should we add extra External Applications such as DTConvert whien that functionality only needs to be developed inside MultiView? I've already been moving in that direction.

Much like my DTConv application you only need three pieces of information to convert datatypes. We can simply use the Save As menu item rather than Export.

So how does it work? Save As brings up a File Requester. We already have a datatype loaded. That is Source. From that and the New Filename we compare File Extensions. If they match do a simple Save As. If not do Convert_Datatype. Simple.

Let's hope it works! MorphOS & Amiga OS4 may try to copy it.


« Last Edit: November 18, 2021, 04:48:49 PM by miker1264 »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2089
    • Karma: +30/-4
  • Peace
Reply #16 on: November 18, 2021, 04:52:25 PM
well miker :)


AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #17 on: November 18, 2021, 04:59:05 PM
Important observation!  8)

The beauty of MultiView is in its simplicity.
With the same simplicity I created a set of Dual-Png icons in the style of AROS One and beyond


miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #18 on: November 18, 2021, 05:30:05 PM
AMIGASYSTEM

I like MultiView5.png

May I borrow it? Could you send it to me?  :)



AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #19 on: November 18, 2021, 06:11:20 PM
I'm attaching the "MultiView5" icons, practically the same as "MultiView8" where I added the musical note since Multiview also plays music!


miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #20 on: November 18, 2021, 08:04:43 PM
AMIGASYSTEM

Thanks for the icons.

Wow! Compare_extension and Convert_datatype worked.  :) :) :)

If the new filename extension matches the original it simply does Save As..

But if it doesn't match it uses Convert_Datatype to save as a new picture type.

This is the code:
                                        //Get new filename extension
                                        char *new_ext = get_ext(fileName);
                                        int len = strlen(new_ext);
                                       
                                        int r = compare_extension(fpath, new_ext, len);
                                        if(r == 1)
                                        {                                           
                                            EasyRequest(NULL, &ResultReq, NULL, "\nFound Match.\n");
                                            copy_file(fpath, fileName);
                                        }
                                        else
                                        {                                           
                                            EasyRequest(NULL, &ResultReq, NULL, "\nNo Match!\n");
                                            SaveAsDatatype(fpath, fileName, new_ext);
                                            //ConvertDatatype(fpath, fileName, new_ext);
                                        }


« Last Edit: November 18, 2021, 09:09:26 PM by miker1264 »



Amiwell

  • Legendary Member
  • *****
    • Posts: 2089
    • Karma: +30/-4
  • Peace
Reply #21 on: November 18, 2021, 08:43:55 PM
excellent :)


miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #22 on: November 18, 2021, 09:13:36 PM
excellent :)

Using Compare_extension I was able to save a png as png (extension match) and save a png as a bmp (no match).  :)

It's a proof of concept. Next I will insert Convert_Datatype from my DTConv application and test with other picture datatypes.

If that's successful I will insert the code into MultiView to test it. Of course there is more needed such as finding which GroupID and verifying basenames. Converting pictures is a good start.
« Last Edit: November 18, 2021, 09:55:28 PM by miker1264 »



AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #23 on: November 18, 2021, 09:36:09 PM
I noticed that DTConv also converts the same format "IFF to IFF", the saved image is slightly different in size.


miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #24 on: November 18, 2021, 09:58:01 PM
I noticed that DTConv also converts the same format "IFF to IFF", the saved image is slightly different in size.

If it's an ILBM image that is likely because the original is compressed. DTM_WRITE in Picture Datatype converts to Uncompressed ILBM. That accounts for differences in size.



AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #25 on: November 18, 2021, 10:52:23 PM
However, even with PNG and JPEG you can do it, the difference is only a few bytes! I think it is a slightly different version of the original, as evidenced by the fact that if you do the conversion of an image already converted this will be identical.


miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #26 on: November 18, 2021, 11:32:45 PM
However, even with PNG and JPEG you can do it, the difference is only a few bytes! I think it is a slightly different version of the original, as evidenced by the fact that if you do the conversion of an image already converted this will be identical.

It uses Datatypes Library just like MultiView. Open the files in MultiView and select Project > Save As...

MultiView doesn't make an exact copy. Instead it saves the data from the current datatype object by using the save function. It reproduces a similar picture file. It may not be an exact copy.

For example if you open a PNG or JPEG with many extra chunks (Chunk ID's) MultiView is only interested in Critical Chunks so it disregards the others. Only the data needed to display the image. So some chunks in the original will not be included.

If you want an exact copy try GIF or BMP or PNM Datatype. Yes. Exactly. Images that have been converted only contain the critical data especially for PNG and JPEG. So they won't change.

« Last Edit: November 18, 2021, 11:37:30 PM by miker1264 »



AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #27 on: November 18, 2021, 11:42:44 PM

For example if you open a PNG or JPEG with many extra chunks (Chunk ID's) MultiView is only interested in Critical Chunks so it disregards the others. Only the data needed to display the image. So some chunks in the original will not be included.

So that's the reason why if you repeat the conversion on the already converted file there will be no difference.

I was thanking you for the bmp.atatypes because I downloaded the version from this thread and the conversion worked, before I had 0 bite file


AMIGASYSTEM

  • Legendary Member
  • *****
    • Posts: 2470
    • Karma: +61/-1
  • AROS One
    • AROS One
Reply #28 on: November 19, 2021, 12:32:02 AM
I wanted to point out that html.datatype exists for AROS but it works badly, the web pages don't show up correctly as on OS3, while hypertext.datatype does not exist on AROS.


On OS3 if one of the two (hypertext.datatype and html.datatype) are not present Multiview doesn't show the web page
« Last Edit: November 19, 2021, 12:35:42 AM by AMIGASYSTEM »



miker1264

  • Legendary Member
  • *****
    • Posts: 1320
    • Karma: +82/-3
Reply #29 on: November 19, 2021, 12:45:23 AM
I wanted to point out that html.datatype exists for AROS but it works badly, the web pages don't show up correctly as on OS3, while hypertext.datatype does not exist on AROS.


On OS3 if one of the two (hypertext.datatype and html.datatype) are not present Multiview doesn't show the web page

Are there OS3 sources for these two datatypes? I haven't looked.