Trying to Run FreeImage Mod

Started by Hardcoal, November 04, 2019, 17:07:19

Previous topic - Next topic

Hardcoal

Hi.

A)  Im on blide, trying to build the module for  Bah FreeImage and I get this error

bah.freeimage was scheduled to next iteration
Build Error: failed to compile D:/Portable/BlitzMax/mod/bah.mod/freeimage.mod/src/FreeImage/PluginJXR.cpp
►►►►bah.freeimage was not built. See error information on latest attempt.

any solution?

B) does anyone knows of a way to load Gif into blitzmax other than freeimage.

C) with lake of choice I would settle with blitz3d
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

markcwm

A) Freeimage is one of the harder to build mods by Brucey, it does work but you need to persevere with different versions to find something that builds.

B) I ported a GIF loader (with animations) from C to B3D and Warner ported it to BMX, http://www.mojolabs.nz/codearcs.php?code=2365

C) Yes there's a good working version of Freeimage 3.10 with B3D, http://www.mojolabs.nz/codearcs.php?code=1732


Hardcoal

I need to convert Gifs onto a single PNG Strip Image. Thats what blitz3d and xors3d works.
I want to be able to drag a Gif onto my Editor and it will turn onto this playable png.

thats the main Idea.
If there is any other way to read a gif so I will be able to turn it onto png that will be what i want
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Dabz

You could try implementing ImageMagick's C++ API into a mod:-

https://imagemagick.org/script/magick++.php

Here's an example from StackOverflow:-


/* list of Image to store the GIF's frames */
std::vector<Magick::Image> imageList;

/* read all the frames of the animated GIF */
Magick::readImages( &imageList, "animated.gif" );

/* optionnally coalesce the frame sequence depending on the expected result */
Magick::coalesceImages( &imageList, imageList.begin(), imageList.end());

/* store each frame in a separate BMP file */
for(unsigned int i = 0; i < imageList.size(); ++i) {
    std::stringstream ss;
    ss << "frame" << i << ".bmp";
    imageList[i].write(ss.str());
}


It looks like a simple enough API to use.

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Hardcoal

I never made mods
I have no idea how to make one atm.
Maybe ill try, will see
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Henri

Hi,

magick mod already exists at https://github.com/maxmods/bah.mod/tree/master/magick.mod

Which version of Blitzmax are you running ?

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Hardcoal

Im running the latest blitzmax i could download
I think it's 1.5
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Henri

Just to get you started:

I downloaded the latest bah.mods from https://github.com/maxmods/bah.mod

I then copied the freeimage.mod folder to <bmx-folder>/mod/bah.mod/

I compiled the mod using MaxIDE-menu option 'Build modules' .The alternative is to use command prompt and cmd to your <bmx-folder>/bin and type bmk makemods -a bah.freeimage.

My MinGW-version is 4.7.1. (in cmd type gcc -v to determine your version). With legacy Blitzmax (not NG) and with this Mingw I get no compile errors and all the examples work (to my surprise I might add). I assume it would work straight away with NG as well.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Dabz

Quote
magick mod already exists

I should of known! :D lol

Dabz
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 16Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit

Hardcoal

#10
Ive managed to finally compile the freeimage doing what henry said.. using (consul)

but now when i try to compile some code, it i get a compile error so im trying to find the mingw 4.7.1
should I uninstall the previous version btw?

anyway i went to Sourceforge for downloading minGW 4.7.1 and he only let me download latest version..
i dont understand how this Sourceforge works..
same story with github.. i dont understand how am i suppose to download presented files there.


Anyway.. my main goal is to turn gif into png.. do you think i can do it with freeimage or magick?  if not .. than im just wasting my time
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

Henri

#11
You can download older version from this link https://sourceforge.net/projects/tdm-gcc/files/TDM-GCC%20Installer/Previous/1.1006.0/tdm-gcc-4.7.1.exe/download

Just untick the search for updates-option in the installer.

Changing the MinGW can be a bit tricky depending on your local setup. Original Blitzmax has libs-folder that contain MinGW libraries, and those same libraries can be found on the MinGW folder as well. Bmk uses the local lib folder to compile modules, so if you don't replace those libraries as well, there is a chance that you might bork your setup.

Best solution would be to download updated bmk from here https://github.com/bmx-ng/bmk (scroll down for instructions on how to install)

After installing, rename your Blitzmax lib folder to something different like pre_libs. This way you know for sure that those lib-files don't cause problems. If you want to be super sure then remove any environment variables from Windows system control panel that mention MinGW (just type them down so that you wont forget them if needed by any chance)

Then install the new/old MinGW to <bmx-folder>/MinGW32x86 folder. New version of the bmk searches those lib files from here by default (x86 means 32-bit).

lastly you need to rebuild all the modules, so that every file is in sync.

I have a hunch that there might be trouble along the way, but do try out. Theoretically everything is reverse-able, but if you do get lost, I'm sure you remembered to backup first :-)

-Henri


EDIT..

There is example 5 and 6 that illustrate how to convert a gif to another format. I haven't used it, but seems to do what you want.
- Got 01100011 problems, but the bit ain't 00000001

Hardcoal

#12
Ok ive done all what youve said.. yet i get same error..
ill keep trying.
Things I've done:   https://itch.io/profile/hardcoal  [I keep improving them btw]

markcwm

You need to rebuild all mods again if you change MinGW version.

Henri

Also, Blides module building system might not be operating as expected. Better use MaxIDE or type in cmd: bmk makemods -a  . '-a'-option means complete rebuilding and if no target module is specified then all modules are rebuilt.

Did you manage to compile Brucey's bmk and deploy it ? Bmk is an independent tool and shouldn't be affecting anything else. It is used just for convenience (it uses threaded building so faster speed, provided that it itself was compiled in threaded mode). Another benefit is, that trying different mingw's is easier, just install new version in <bmx-folder>/MinGWx86 and rebuild mods. When installing new MinGW it is perhaps better to omit any PATH updating options so that mingw is contained only within this folder.

You can check if any MinGW is in PATH by typing gcc -v in cmd. If MinGW is in the PATH then there might be a chance that it is used for compiling instead of perhaps what you are expecting. The worst scenario is that there are multiple MinGW's in PATH. You can show the content of PATH variable by typing path in cmd.

-Henri
- Got 01100011 problems, but the bit ain't 00000001