New Image plugin available for beta-testing

Developed or developing a new product in PureBasic? Tell the world about it.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: New Image plugin available for beta-testing

Post by PB »

> I'm not going to argue here about the GIF/LZW issue

Don't worry about it: the GIF license/patent expired on 20 June 2003 and
is now completely Public Domain (http://www.kyz.uklinux.net/giflzw.php). :)
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: New Image plugin available for beta-testing

Post by Danilo »

PB wrote:Don't worry about it: the GIF license/patent expired on 20 June
2003 and is now completely Public Domain
(http://www.kyz.uklinux.net/giflzw.php). :)
Not in all countries, so you cant say it generally in an international
forum.

You can use the above procedures anyway because it does not
contain an LZW decoder, only a call to Windows API.
Its not the file format that is/was protected, its the LZW algorithm
for decoding and encoding. If you dont have this de-/encoder
in your source, you are on the safe side anyway.
If somebody wants to put you before a court of law, you can
show your sources to the court and they can see the algorithm
in question isnt used in your sources.
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
LCD
Enthusiast
Enthusiast
Posts: 206
Joined: Sun Jun 01, 2003 10:55 pm
Location: Austria, Vienna
Contact:

Post by LCD »

El_Choni wrote:The plugin works here. Could you please post the image/s you can´t load? (and specify if you use LoadImage(), CatchImage() or what). Thanks,
I'm back now...
To your question:
All JPG's/GIF's did not load, even if they previously worked well. LoadImage() produces a zero result. It was working okay with previous version of my program, but the source grown up to circa 400 Kb, and then it suddenly stopped to work without any change in the loader code.

@Danielo, your source works, but it produces a black line at the top of the image, so I changed

Code: Select all

Pic\Render(hDC,0,PicHeight,PicWidth,-PicHeight,0,0,Width,Height,0)
to

Code: Select all

Pic\Render(hDC,0,PicHeight,PicWidth,-PicHeight-1,0,0,Width,Height,0)
Now it works better.
My PC
Ryzen 9 5950, 64 GB RAM, nVidia RTX A4000, Win 10
Ryzen 7 1700, 32 GB RAM, nVidia RTX A2000, Win 10
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Well, I only can say that it works here. I you have the latest version of the plugin (2.0) and still doesn't work, use Danilo's code (it does quite the same thing as the plugin).

Unless you want to send me the failing code, so I can try it here.
El_Choni
coma
Enthusiast
Enthusiast
Posts: 164
Joined: Fri Aug 15, 2003 3:46 am
Location: Canada

Post by coma »

El_Choni :
The plugin works here. Could you please post the image/s you can´t load? (and specify if you use LoadImage(), CatchImage() or what).
is it possible to use CatchImage with your plugin ?

danilo:
can't we use png files with your code ?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

is it possible to use CatchImage with your plugin ?
Yes.
El_Choni
coma
Enthusiast
Enthusiast
Posts: 164
Joined: Fri Aug 15, 2003 3:46 am
Location: Canada

Post by coma »

only with bmp files ?
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Should work with gif, jpg, wmf, ico, cur and bmp files, iirc.
El_Choni
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Hi El_Choni,

LoadImage () does not work with AVIFIL32.DLL. Duno why :(
Please try this:

Code: Select all

  UseEC_OLEImageDecoder()
  #Lib = 5
  If OpenLibrary  ( #Lib , "AVIFIL32.DLL") 
   Debug LoadImage( #LoadImg, "C:\Temp\test.gif" ) ; > 0
    CallFunction ( #Lib,  "AVIFileInit" )
    Debug LoadImage( #LoadImg, "C:\Temp\test.gif" ) ; = 0
  endif
cya dige
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Thanks, I'll have a look. Regards,

EDIT: works here (Windows 98 SE). Could you try this?:

Code: Select all

Debug Hex(EC_OLEImagePluginVersion())
Should show 20001. If it doesn't show that number, download the latest version. If it still doesn't work, I don't know right now which could be the problem.
El_Choni
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Reinstalled the plugin from ressource site and purearea.net ... but version
is still "20000".

regards,

dige
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

OMG, so I didn't upload it! LOL! I'll do it ASAP, maybe I take my time to include a help file if I can. In the meantime, you can download the lib, only the lib, at:

http://www.terra.es/personal5/temporald ... ePluginOLE

Regards,
El_Choni
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Okay, version is now "20001", but unfortunately nothing changed.
The following code does not work with WinXPSP1 and PB3.81 and 3.9

Code: Select all

UseEC_OLEImageDecoder()
If OpenLibrary  ( #Null , "AVIFIL32.DLL")
  Debug LoadImage( #Null, "C:\Temp\test.gif" ) ; Result > 0
  CallFunction ( #Null,  "AVIFileInit" )
  Debug LoadImage( #Null, "C:\Temp\test.gif" ) ; Result = 0
EndIf

PB3.9 Errors:

Code: Select all

Functions\Image .text: undefined reference to '_OleUninitialize@0'
Functions\Image .text: undefined reference to '_OleInitialize@4'
Functions\Image .text: undefined reference to '_CreateStreamOnHGlobal@12'

Is it possible to get some debug information?

cya dige[/code]
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Ok, this is useful info. This probably means that these API functions are, in XP, in a different DLL of that that the lib uses. For some reason, Windows includes these functions in two or three DLLs in Windows 98. I'll rewrite it to use other DLL and see if it works, thanks,

EDIT: Could you download and try it again, please?
El_Choni
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

Hi,

Still works here. Could you try downloading this new version, please?

http://www.terra.es/personal5/temporald ... ePluginOLE

Tell me if you get any errors, please. Regards,
El_Choni
Post Reply