Recent

Author Topic: Two issues on Lazpaint  (Read 725 times)

Tommi

  • Full Member
  • ***
  • Posts: 219
Two issues on Lazpaint
« on: October 22, 2024, 11:11:20 am »
Under Ubuntu Linux the Lazpaint openFile appears very very large and goes out from the display. The cause is that Raw types filter is too long.
I solved this with this change in URaw.pas:
Code: [Select]
function GetAllRawExtensions(a:byte): string;
var
  i: Integer;
begin
  result := '';
  for i := (a-1)*10 to min(a*10-1,high(RawFileExtensions)) do
  begin
    if result <> '' then result += ';';
    result += RawFileExtensions[i].ext;
  end;
end;

function IsRawFilename(AFilename: string): boolean;
var
  ext: String;
begin
  ext := LowerCase(ExtractFileExt(AFilename));
  delete(ext,1,1);
  result := Pos(';'+ext+';',';'+AllRawExtensions1+';'+';'+AllRawExtensions2+';'+';'+AllRawExtensions3+';') <> 0;
end;
And under Initialization:
Code: [Select]
  AllRawExtensions1 := GetAllRawExtensions(1);
  AllRawExtensions2 := GetAllRawExtensions(2);
  AllRawExtensions3 := GetAllRawExtensions(3);

In UFileExtennsions I did:
Code: [Select]
initialization

...
...


  RegisterPicExt('Raw',AllRawExtensions1, [eoReadable]);
  RegisterPicExt('Raw',AllRawExtensions2, [eoReadable]);
  RegisterPicExt('Raw',AllRawExtensions3, [eoReadable]);

The other issue is that it always says that python scripts are unsecure. I solved (worked around) it doing (in UPython.pas):
Code: [Select]
  var idx: integer;
    fromClause: boolean;
    moduleName, subId: string;
    isSafe: boolean;
  begin
    exit(true);      <---- Change (row 343)
    if importCount <> 1 then exit(false); // syntax error
« Last Edit: October 22, 2024, 11:13:08 am by Tommi »

circular

  • Hero Member
  • *****
  • Posts: 4378
    • Personal webpage
Re: Two issues on Lazpaint
« Reply #1 on: October 24, 2024, 12:57:15 pm »
Hello Tommi!

Thank you very much for your feedback.

I will look into your proposal to reduce the dialog box. This can greatly improve on the UI indeed.

Regarding Python scripts, would you have a sample script that you're trying to run that you can provide?

Regards

Conscience is the debugger of the mind

Tommi

  • Full Member
  • ***
  • Posts: 219
Re: Two issues on Lazpaint
« Reply #2 on: October 25, 2024, 09:45:37 am »
Hi,
Regarding scripts I have that effect on all script embedded in LazPaint, "Version" script as well.

circular

  • Hero Member
  • *****
  • Posts: 4378
    • Personal webpage
Re: Two issues on Lazpaint
« Reply #3 on: October 28, 2024, 01:06:12 am »
Ok, thanks!
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018