pyscripter / python4delphi

Free components that wrap up Python into Delphi and Lazarus (FPC)
MIT License
895 stars 307 forks source link

Error #422

Closed sparta2025 closed 1 year ago

sparta2025 commented 1 year ago

error of the type of addition to the file name of type x0 or x9, and the file name 224.jpg can be converted to x92.jpg . Very similar to erroneous Assemblera type operators - some kind of case shift

pyscripter commented 1 year ago

This is not a valid bug report.

sparta2025 commented 1 year ago

This erros: (simple application, 2 image in directory project, Windows 10 64 LTSC Delpho 10.4.2 P4D and Error2.zip

Traceback (most recent call last): File "", line 2, in File "C:\ProgramData\anaconda3\lib\site-packages\PIL\Image.py", line 3227, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'C:\Error2ð.jpg'

pyscripter commented 1 year ago

And why do you believe this is a P4D issue?

sparta2025 commented 1 year ago

File is open, but name 24x150.jpg -> x14150.jpg Traceback (most recent call last): File "", line 2, in File "C:\ProgramData\anaconda3\lib\site-packages\PIL\Image.py", line 3227, in open fp = builtins.open(filename, "rb") OSError: [Errno 22] Invalid argument: 'C:\Project Seg Delphi 10.4\Images\x14x150.jpg'

file are opened and uploaded, but name file 224.jpg -> x94.jpg. Traceback (most recent call last): File "", line 2, in File "C:\ProgramData\anaconda3\lib\site-packages\PIL\Image.py", line 3227, in open fp = builtins.open(filename, "rb") FileNotFoundError: [Errno 2] No such file or directory: 'C:\Project Seg Delphi 10.4\Images\x94.jpg'

I don't know why this is happening.

sparta2025 commented 1 year ago

The file opening dialog normally reads the path to the file and displays it in a text field. In general, it is not critical, but still.

pyscripter commented 1 year ago

You need to use a raw string for the path.

       TextStrings.Text:=
         'from PIL import Image'+ sLineBreak +
         'image_open = Image.open(r' + QuotedStr(OpenDialog1.FileName) + ')';

This is not a bug report. Please use the support forum for "Why my program does not work" questions.