Recent

Author Topic: LazPaint (alpha-blending, antialiasing, filters)  (Read 651020 times)

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #570 on: July 09, 2014, 01:21:59 am »
Are you talking about uimagelist.pas?
Conscience is the debugger of the mind

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #571 on: July 09, 2014, 05:24:16 am »
I'm talking about gpl and how it is unacceptable for libraries and components, the minimum requirements for any library is the modified lgpl that lazarus is using and only if the library is big enough that rewriting it would be out of the question if it is small eg bgrabitmap then a rewrite or an alternative will be used to avoid any potential problems.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #572 on: July 09, 2014, 11:58:51 pm »
Ah I understand. Well LGPL is convenient for components.

However we are talking about LazPaint software, not BGRABitmap library.
Conscience is the debugger of the mind

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #573 on: July 10, 2014, 05:56:42 am »
lgpl is not ok for components that static linking is forcing me in to gpl and I was talking about the imagelist so not so much about lazpaint. In any case it is your components and your program so after voicing my license objections I'll let you move on with your development and thank you for your time.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #574 on: July 10, 2014, 09:42:49 am »
I mean uimagelist.pas only, since LazPaint is GPL.

It's a general practice, that all PAS files have a copyright notice in their headers, something like this:

{
    Name of product- product description.
    Copyright (C) 20xx-2014  Name of Authors

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
}

Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL.
Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I got the impression, that *taaz is not talking about  uimagelist.pas, but generally, do I understand things right?
Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.

I am still waiting for Circulars opinion on items 2 and 4, so I will know if I should take some activities.
« Last Edit: July 10, 2014, 09:59:06 am by paskal »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #575 on: July 10, 2014, 11:14:58 am »
It's a general practice, that all PAS files have a copyright notice in their headers, something like this:
That's a license statement + a copyright notice ;) But yes, it can help if you are dealing with various licenses in one project...

Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.
No idea where you read that. You're not allowed to link GPL units into (basically) non-GPL licensed programs, but you are allowed to do that with LGPL. As taazz indicated, GPL is not enough for libraries for many people (me included) for that reason.
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #576 on: July 10, 2014, 12:09:47 pm »
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #577 on: July 10, 2014, 12:21:53 pm »
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
depends on what kind of "do what you want with the code" you are after. For example the mpl requires that any enhancements on the library it self is suppose to be made public as well anything else can be under any license as long as the source is mentioned on the about box. if you want to allow a more "free" usage eg even enhancements can be on any license then a derivative of BSD should do the job. Personally for components and libraries I prefer the MPL, although the ip stack that every modern system has build in began its life on BSD license.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #578 on: July 10, 2014, 05:15:01 pm »
I got the impression, that *taaz is not talking about  uimagelist.pas, but generally, do I understand things right?
Yes I guess tazz is talking about imagelist component of Lazarus.

Quote
Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL. Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I understand, however it is too dependent here to be separate component. In order to make it a component, I guess the simplest thing would be to do a package (we can put it on LazPaint repository or another one). Then you'll see when compiling it if it is independent. You will need to add some way to define the labels instead of using the constants from uresourcestring.pas and to set the list of file types.

Quote
Edit... I just read some more about LGPL. It seems more restrictive than GPL, I have no idea  why I've got the opposite impression.
It is less restrictive for me, because it allows to be embedded into another program with another license.
Conscience is the debugger of the mind

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #579 on: July 11, 2014, 07:32:03 am »
 quote author=taazz link=topic=12037.msg152148#msg152148 date=1404987713]
Eeer, any idea what license should be used for "do what you want with the code, just mention the source in the about info, so other people can find and use it easily?"
depends on what kind of "do what you want with the code" you are after. For example the mpl requires that any enhancements on the library it self is suppose to be made public as well anything else can be under any license as long as the source is mentioned on the about box. if you want to allow a more "free" usage eg even enhancements can be on any license then a derivative of BSD should do the job. Personally for components and libraries I prefer the MPL, although the ip stack that every modern system has build in began its life on BSD license.

MPL seems too restrictive for this case. BSD licenses seem fine.

Quote
Since uimagelist.pas (with some changes) can be used for similar purposes in other apps, I would prefer it to be released under LGPL. Because LGPL is less restrictive than GPL, I think there is no problem for a GPL app tu use LGPL components?
I understand, however it is too dependent here to be separate component. In order to make it a component, I guess the simplest thing would be to do a package (we can put it on LazPaint repository or another one). Then you'll see when compiling it if it is independent. You will need to add some way to define the labels instead of using the constants from uresourcestring.pas and to set the list of file types.
There is a point in that.
But I there is an issue: someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?

Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #580 on: July 11, 2014, 01:27:35 pm »
Here are my answers, Paskal. Please tell me if you intend to take care of one of those so that we do not do it twice.

And with the fixes came some bugs : :-X

1. If some of the files added to the main window of LazPaing by drag and drop is not supported an error message is shown that the file is not supported and no files are added. AFAIR I have tested this before sending the patch- an error message used to be shown, but all other files were added.
I see no reason why this message should be shown in this particular situation, I just kept your previous behaviour.
The reason is that if there are 50 files that cannot be opened, this will show 50 message boxes. Otherwise we can agglomerate error messages for the different files and display them in one single message box, and load the image with the files that could be read.

Quote
In uimagelist.pas there is a function IsExtensionValid. You might consider to move it to a PAS file with global functions and use it in the main form, too.
Yes, in any case, it would be a good thing to put this in a separate unit as simple procedures/functions. Then, this unit could be moved to any package.

Quote
2. You have changed shortcuts for Next and Previous image from the image list to Alt+Left and Alt+Right.
2.1. Now when I press one of the shortcuts an image is skipped, i.e. if file 3 is open, the next open file is 5, instead of 4.
I think the reason is that pressing the arrow key moves the selected row a line up/down, and after that the procedure is called and the line is moved once again.
The problems is that I cannot disable keyboard navigation (auto advance:=false does not help).
One possible solution is to store the current row and increment it upon alt-Left/right.
Could there be another way out?
Edit: I fixed it by disabling stringgrid on Alt, and reenabling it on KeyUp. I will submit a patch, unless you prefer another solution.
That is a way to solve it. That said, Key variable should be set to zero to say it has been processed. This could solve the problem too.

Quote
2.2. I have assigned Space and BackSpace because they are active only when the imagelist is active. Maybe with  Alt+Left and Alt+Right these shortcuts should become global?
That is why I changed the shortcuts, to make them global shortcuts. Space and Backspace obviously interferes with tools input.

Quote
3.  When files are added to the image list the first one is opened automatically. I am not sure that this is a good idea, maybe some settings checkbox should be used? I would ask other users (if any) opinions.
Yeah I don't know. I thought that it would be quicker. Also the problem is that when we click the Next arrow, it opens the second file when in my opinion if the first one has not been opened, it should be opened at this moment.

Quote
4. I wonder- maybe the imagelist shall show automatically, after files are dragged and dropped in the image list? What do you think?
I suppose you mean when files are dropped in LazPaint, and that we choose to open in image list? Yes that is a good idea.

Quote
5. On Line 307 WidthMinimal:=300 shall become WidthMinimal:=340, because of the increased number of buttons.
Ok.

Quote
6. I saw some Paskal added in the About info. If you insist that my name should be added there, I'd rather prefer to be quoted under Contributors, or if that is not okay- as СМ630.
So to add a line under Author? If you like, yes.

Quote
8. Just a reminder to myself, so I don;'t forget for thenext release of LazPaint- to add files to the image list trough commande line...if it makes sense.
That can prove useful if you call LazPaint from a batch file or a third party program.
Conscience is the debugger of the mind

circular

  • Hero Member
  • *****
  • Posts: 4195
    • Personal webpage
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #581 on: July 11, 2014, 01:45:48 pm »
someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?
If someone posts a function, I suppose he/she does not mind it being GPL/LGPL/MPL/BSD. If you want to be clear in your code, you can write before the function something like "This function comes from a public forum and can be reused without any restriction".
Conscience is the debugger of the mind

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #582 on: July 11, 2014, 01:56:27 pm »
But I there is an issue: someone posts a function, for example in this forum. Then I use it in my source. If I publish my source (for example) under GPL, it will contain functions, which I do not own and therefore I cannot apply restrictions on them. So what to to then? Shall these functions have standalone licensing, or shall they be put in a separate unit, with separate licensing?
Maybe that shall be discussed in another thread in another section of the forum?
I think it is a very good idea to split off that discussion to a new discussion thread in an a more relevant section. I'm sure though that you'll get very many responses...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #583 on: July 11, 2014, 03:26:30 pm »
 
Here are my answers, Paskal. Please tell me if you intend to take care of one of those so that we do not do it twice.

And with the fixes came some bugs : :-X

1. If some of the files added to the main window of LazPaing by drag and drop is not supported an error message is shown that the file is not supported and no files are added. AFAIR I have tested this before sending the patch- an error message used to be shown, but all other files were added.
...
The reason is that if there are 50 files that cannot be opened, this will show 50 message boxes. Otherwise we can agglomerate error messages for the different files and display them in one single message box, and load the image with the files that could be read.
 

I like the idea of agglomerating error messages. What about a for with a Memo inside and an Okay button? Next week I will check if I can talk with the file opening function.
Quote
In uimagelist.pas there is a function IsExtensionValid. You might consider to move it to a PAS file with global functions and use it in the main form, too.

Yes, in any case, it would be a good thing to put this in a separate unit as simple procedures/functions. Then, this unit could be moved to any package.
 

Okay, please tell a name for the unit.
Quote
2. You have changed shortcuts for Next and Previous image from the image list to Alt+Left and Alt+Right.
2.1. Now when I press one of the shortcuts an image is skipped, i.e. if file 3 is open, the next open file is 5, instead of 4.
I think the reason is that pressing the arrow key moves the selected row a line up/down, and after that the procedure is called and the line is moved once again.
The problems is that I cannot disable keyboard navigation (auto advance:=false does not help).
One possible solution is to store the current row and increment it upon alt-Left/right.
Could there be another way out?
Edit: I fixed it by disabling stringgrid on Alt, and reenabling it on KeyUp. I will submit a patch, unless you prefer another solution.
That is a way to solve it. That said, Key variable should be set to zero to say it has been processed. This could solve the problem too.

Quote
2.2. I have assigned Space and BackSpace because they are active only when the imagelist is active. Maybe with  Alt+Left and Alt+Right these shortcuts should become global?
That is why I changed the shortcuts, to make them global shortcuts. Space and Backspace obviously interferes with tools input.
Still they are not global. So if you have no other solution for item 2,1 I will submit a patch for mine. I will check if I can make shortcuts global.

Quote
3.  When files are added to the image list the first one is opened automatically. I am not sure that this is a good idea, maybe some settings checkbox should be used? I would ask other users (if any) opinions.
Yeah I don't know. I thought that it would be quicker. Also the problem is that when we click the Next arrow, it opens the second file when in my opinion if the first one has not been opened, it should be opened at this moment.
 

The last one is a point, indeed. So I will leave autoopening, only if there are no other files in the filelist. If there are files, already, a new file will not be open. Does it sound okay?
Quote
4. I wonder- maybe the imagelist shall show automatically, after files are dragged and dropped in the image list? What do you think?
I suppose you mean when files are dropped in LazPaint, and that we choose to open in image list? Yes that is a good idea.
 

I will do it.
Quote
5. On Line 307 WidthMinimal:=300 shall become WidthMinimal:=340, because of the increased number of buttons.
Ok.
 
I'll fix that.
Quote
6. I saw some Paskal added in the About info. If you insist that my name should be added there, I'd rather prefer to be quoted under Contributors, or if that is not okay- as СМ630.
So to add a line under Author? If you like, yes.
 
I mean that I do not like the idea to be listed as "Paskal". I am okay being named as Contributors  ;D .
« Last Edit: July 11, 2014, 03:40:47 pm by paskal »
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: LazPaint (alpha-blending, antialiasing, filters)
« Reply #584 on: July 11, 2014, 03:43:53 pm »
If someone posts a function, I suppose he/she does not mind it being GPL/LGPL/MPL/BSD. If you want to be clear in your code, you can write before the function something like "This function comes from a public forum and can be reused without any restriction".
When I post my code I would not like someone to take rights over it and to prevent others, including myself to use it. I had a project in Berlios, I think it is in SF now, and I do include information for subs, which are not made by myself.
Anyway, I will start a thread in the Global section.
Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018