You are here

PNG in Portable Apps Menu

8 posts / 0 new
Last post
El Salvador
Offline
Last seen: 14 years 10 months ago
Joined: 2005-12-09 10:10
PNG in Portable Apps Menu

Hello everybody. These day, I'm working on PAM to integrate it in my launcher (ASuite) as new menu and I conceived to add png support. Therefore I'm looking for a component to read png files.

I found this component: ImageFileLib ( https://sourceforge.net/projects/imagefilelib/ ), released under no license (public domain?). I tried to convert a png to bmp and load it in a TImage component. It seem works fine.

I used this simple code (in form's event create):

procedure TForm1.FormCreate(Sender: TObject);
var
  PNG :TPNGGraphic;
  BMP :TBitmap;
begin
  BMP :=TBitmap.Create;
  PNG :=TPNGGraphic.Create;
  try
    PNG.LoadFromFile('xyz.png');
    BMP.Assign(PNG);
    Image1.Picture.Bitmap := BMP;
  finally
    BMP.Free;
    PNG.Free;
  end;
end;
John T. Haller
John T. Haller's picture
Online
Last seen: 48 min 15 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not GPL Compatible

The license in the readme states: "This source code may be used in freeware products and free source distributions either in the original or modified form. I only require that my name is mentioned in the program (e.g. in the about box) or documentation. The library may not be used in commercial products without permission from the author (send an e-mail with short description of the application). See JasPerLib\jasper-1.700.2\license for license information regarding the included JasPer library."

Due to it's non-commercial requirement, it is not compatible with the GPL or LGPL and can not be compiled or linked to GPLed or LGPLed code.

That's one of a few PNG libraries I found... none of which meet the criteria for an OSI-approved license (thus, they're not really open source).

Sometimes, the impossible can become possible, if you're awesome!

vexorian
Offline
Last seen: 17 years 6 months ago
Joined: 2007-01-27 12:45
sourceforge

Sourceforge is supposed to host only OSI licensed software, I guess someone will have to tell the admins at sourceforge about this so they shut down that project.
--

Anyways, the official libpng is OSI approved.

El Salvador
Offline
Last seen: 14 years 10 months ago
Joined: 2005-12-09 10:10
"The license in the readme

The license in the readme states: "This source code may be used in freeware products and free source distributions either in the original or modified form. I only require that my name is mentioned in the program (e.g. in the about box) or documentation. The library may not be used in commercial products without permission from the author (send an e-mail with short description of the application). See JasPerLib\jasper-1.700.2\license for license information regarding the included JasPer library."
D'oh. I didn't read readme. In project page on sourceforge there is this:
License: (None Listed)

I will continue to seek, but maybe I will waste time.

Ah John, in PAM I convert imgBackground's image from bmp to jpeg and PAM's exe make small: from 1400KB to 750KB about.

El Salvador
Offline
Last seen: 14 years 10 months ago
Joined: 2005-12-09 10:10
I found another component.

I found another component. Unfortunately it needs lpng.dll to work.
Download link: http://www.salvadorsoftware.com/download/lpngDelphi.zip

License: I downloaded this component (and dll) from The Pythian Project, a GPL software. Anyway units and dll uses zlib/libpng license (it is compatible with the GPL).

Code example to convert png to bmp and use it in a TImage component:

procedure TForm1.Button1Click(Sender: TObject);
var
  PNG : TPngImage;
  BMP : TBitmap;
begin
  PNG := TPngImage.Create;
  BMP := TBitmap.Create;
  try
    PNG.ForceColor := true;
    PNG.LoadFromFile('xyz.png');
    PNG.CopyToBmp(BMP);
  finally
    PNG.Free;
  end;
  Image1.Picture.Bitmap := BMP;
end;
dragonmage
Offline
Last seen: 1 year 10 months ago
Joined: 2007-01-15 02:25
Transparency?

Would this allow for per-pixel transparency?

dragonmage
Offline
Last seen: 1 year 10 months ago
Joined: 2007-01-15 02:25
I'm glad

someone with more knowledge of the licensing stuff is on the hunt.

SmithTech
SmithTech's picture
Offline
Last seen: 2 years 7 months ago
Developer
Joined: 2006-11-24 18:06
How about

How about this
http://freeimage.sourceforge.net
Says it supports PNG, Delphi, and is released under GPL or FIPL which ever works better for the developer.

"Because they stand on a wall and say, 'Nothing is going to hurt you tonight. Not on my watch.'" (A Few Good Men)
Coincidence is God's way of remaining anonymous.(Albert Einstein)

Topic locked