1. bitmaps
- Posted by irv May 07, 2015
- 1644 views
Have read_bitmap() and related functions been deprecated from 4.1 beta 2?
Not that I have any use for them, but I tried both on Linux and on Windows, and get an error code of 4 returned when trying read_bitmap on known-good .bmp images.
2. Re: bitmaps
- Posted by ghaberek (admin) May 07, 2015
- 1658 views
According to the docs, "Bitmaps of 2, 4, 16 or 256 colors are supported. If the file is not in a good format, an error code (atom) is returned instead."
Do your bitmaps fit this criteria?
-Greg
3. Re: bitmaps
- Posted by ghaberek (admin) May 07, 2015
- 1642 views
The 4.1 docs include this:
public constant BMP_OPEN_FAILED = 1, BMP_UNEXPECTED_EOF = 2, BMP_UNSUPPORTED_FORMAT = 3
But std/graphcst.e includes this:
public enum BMP_SUCCESS, BMP_OPEN_FAILED, BMP_UNEXPECTED_EOF, BMP_UNSUPPORTED_FORMAT, BMP_INVALID_MODE
So your result of 4 is indeed BMP_UNSUPPORTED_FORMAT.
-Greg
4. Re: bitmaps
- Posted by petelomax May 07, 2015
- 1665 views
The 4.1 docs include this:
public constant BMP_OPEN_FAILED = 1, BMP_UNEXPECTED_EOF = 2, BMP_UNSUPPORTED_FORMAT = 3
But std/graphcst.e includes this:
public enum BMP_SUCCESS, BMP_OPEN_FAILED, BMP_UNEXPECTED_EOF, BMP_UNSUPPORTED_FORMAT, BMP_INVALID_MODE
So your result of 4 is indeed BMP_UNSUPPORTED_FORMAT.
-Greg
So either the docs are wrong, as BMP_SUCCESS is now 1, BMP_OPEN_FAILED is now 2, etc, or that enum should begin with BMP_SUCCESS=0
5. Re: bitmaps
- Posted by irv May 07, 2015
- 1661 views
Erm.. the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example, as well as some from the web and some generated by Gimp (converted mongoose for example). All return 4
add: all are visible using the respective platforms' image viewer(s).
6. Re: bitmaps
- Posted by ghaberek (admin) May 07, 2015
- 1647 views
the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example,
256-color images are "8-bit" and yours is 32.
- Browse to C:\Windows\System32\migwiz\PostMigRes\Web\base_images
- Right-click WindowsOutlookExpress.bmp
- Click Properties
- Select Details tab
- Observe Bit depth is 32
add: all are visible using the respective platforms' image viewer(s).
This is not an indicative test of compatibility. Euphoria's bitmap routines are extremely limited.
-Greg
7. Re: bitmaps
- Posted by ghaberek (admin) May 07, 2015
- 1621 views
So either the docs are wrong, as BMP_SUCCESS is now 1, BMP_OPEN_FAILED is now 2, etc, or that enum should begin with BMP_SUCCESS=0
I believe you are correct in that BMP_SUCCESS should be 0:
-Greg
8. Re: bitmaps
- Posted by irv May 07, 2015
- 1659 views
the bitmaps I used to test with were from Windows 7 - WindowsOutlookExpress.bmp, for example,
256-color images are "8-bit" and yours is 32.
- Browse to C:\Windows\System32\migwiz\PostMigRes\Web\base_images
- Right-click WindowsOutlookExpress.bmp
- Click Properties
- Select Details tab
- Observe Bit depth is 32
add: all are visible using the respective platforms' image viewer(s).
This is not an indicative test of compatibility. Euphoria's bitmap routines are extremely limited.
-Greg
So they are. Isn't that just another thing that detracts from Euphoria's popularity?
Not that Eu should support *any* kind of images, that's not my point. Anyone interested in working with images is very unlikely to be doing so in a text mode, I suspect.
Therefore, since the Eu user will probably be using either wxWindows, EuGTK, or something similar, those libraries already have a lot of support for images built in. Euphoria itself needs none at all.
9. Re: bitmaps
- Posted by ghaberek (admin) May 07, 2015
- 1657 views
So they are. Isn't that just another thing that detracts from Euphoria's popularity?
Not that Eu should support *any* kind of images, that's not my point. Anyone interested in working with images is very unlikely to be doing so in a text mode, I suspect.
Therefore, since the Eu user will probably be using either wxWindows, EuGTK, or something similar, those libraries already have a lot of support for images built in. Euphoria itself needs none at all.
This is true. I'm pretty sure these bitmap routines are a holdout from the days of DOS graphics mode support. They're still hanging around because they were still "cross-platform" without DOS graphics.
-Greg
10. Re: bitmaps
- Posted by petelomax May 07, 2015
- 1636 views
I've updated my version of the docs with:
Deprecated. Most graphics are now 24 or 32 bit which this routine does not support. However, as long as 256 colours (8-bit) or less is acceptable, this routine remains perfectly useable, and may still be the right choice for simple cross-platform applications.
and replaced "The most common variations of the format are supported." with "Only low-res uncompressed variations of the format are supported."
Pete
11. Re: bitmaps
- Posted by Ekhnat0n May 15, 2015
- 1590 views
how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?
For me that would be the way to go in making bulky 'Win-emulators' not necessary,
Using Winlibs is making the same error MSoft does
i.e. including vast .dll-files from which only 6 or 7 'sub-routines' are actually used.
12. Re: bitmaps
- Posted by jimcbrown (admin) May 15, 2015
- 1588 views
how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?
While it's probably not super difficult, I think the language would be better off in the long term integrating with GIMP or a library which provides similar functionality. Otherwise, someone will just complain about lack of PNG/TIFF/JPG/GIF/MNG/etc support....
13. Re: bitmaps
- Posted by irv May 15, 2015
- 1581 views
how hard would it be to upgrade the bitmap-function(s) to 32 and even 64 bits?
While it's probably not super difficult, I think the language would be better off in the long term integrating with GIMP or a library which provides similar functionality. Otherwise, someone will just complain about lack of PNG/TIFF/JPG/GIF/MNG/etc support....
We need to step back and think about this rationally.
How many people will want to work with images without using any GUI library (GTK, wxWindows, Windows...)?
I submit that there are a few, - very few - and they will use ImageMagik or similar. Euphoria could never match those capabilities.
The rest of us will use a GUI, and AFAIK, all of those have the capability of loading, displaying, and resizing images of most types.
Any needs beyond those simple ones are probably best left to actual image editing programs, such as Gimp. Euphoria could never equal those capabilities either, and shouldn't try, since it is a programming language, not an image editor.
14. Re: bitmaps
- Posted by BRyan May 15, 2015
- 1602 views
There is plenty of support in Euphoria for images in the archive.
http://rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=image