Problems with batch file

previously known as VSO Image Resizer

Moderator: Fabrice

Donato
Junior Member
Posts: 2
Joined: Sat Apr 08, 2023 7:11 pm

Problems with batch file

Post by Donato »

I have a problem with running a batch file

If I run batch fil from cmd it runs perfectly. If I run the same batch file in my program it doesn't run. the log have no errors but it doesn't work

2023-04-08 19:02:39 Info Paramstr #00 : "C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe"
2023-04-08 19:02:39 Info CPU: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
2023-04-08 19:02:39 Info Memory: 64,00 GB
2023-04-08 19:02:39 Info Screen DPI : 96
2023-04-08 19:02:39 Info Screen resolution : 1280 x 800, 32 bit
2023-04-08 19:02:39 Info System default language : Italiano (Italia)
2023-04-08 19:02:39 Info User default language : Italiano (Italia)
2023-04-08 19:02:39 Info Version : 6.1.6.0
2023-04-08 19:02:39 Info ExeName : C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe
2023-04-08 19:02:39 Info OS : Windows 10 Server Datacenter (full installation) Datacenter (Version 1809, Build 17763)
2023-04-08 19:02:39 ---- ******************** Log session start 2023-04-08 19:02:39.719 PID 26444********************


the file has only one line
"C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\resize.exe" %1 /profile=APULIA /run

where the "%1" is the complete path of image

the log , when I run it successfully in cmd windows is
2023-04-08 18:52:22 ---- ******************** Log session stop 2023-04-08 18:52:22.722 PID 23784********************
2023-04-08 18:52:22 Info Space saved: 2,70 KB (-36,81%)
2023-04-08 18:52:22 Info 1 image processed in 00:00:01.
2023-04-08 18:52:22 Info [6] Resizing "E:\Arxivar_data\Doc\Archive_2023\04\08\18\259d0cffb36d4dd8a4760bd7c9cdc216.jpg" [JPG] from 307x192 to 181x113. Saved as "E:\Arxivar_data\Doc\Archive_2023\04\08\18\259d0cffb36d4dd8a4760bd7c9cdc216 (Copia).jpg"
2023-04-08 18:52:22 Info 1 files
2023-04-08 18:52:22 Info --- Processing ---
2023-04-08 18:52:22 Info Destination: <original>
2023-04-08 18:52:22 Info Action: Create copies
2023-04-08 18:52:22 Info [ ] Remove background
2023-04-08 18:52:22 Info [ ] JPEG compression optimization
2023-04-08 18:52:22 Info [ ] Optimize PNG files with OptiPNG
2023-04-08 18:52:22 Info [ ] Split into parts
2023-04-08 18:52:22 Info [ ] Send by email
2023-04-08 18:52:22 Info [ ] Customize Metadata
2023-04-08 18:52:22 Info [X] Copy ICC
2023-04-08 18:52:22 Info [X] Copy IPTC
2023-04-08 18:52:22 Info [X] Copy XMP
2023-04-08 18:52:22 Info [X] Copy EXIF
2023-04-08 18:52:22 Info On name conflict: Prompt
2023-04-08 18:52:22 Info [ ] Keep file date
2023-04-08 18:52:22 Info [ ] Adjust portrait
2023-04-08 18:52:22 Info [ ] Flip image
2023-04-08 18:52:22 Info [ ] Rotate image
2023-04-08 18:52:22 Info [ ] Round edges
2023-04-08 18:52:22 Info [ ] Contrast
2023-04-08 18:52:22 Info [ ] Brightness
2023-04-08 18:52:22 Info [ ] Auto enhance
2023-04-08 18:52:22 Info [ ] Add border
2023-04-08 18:52:22 Info [ ] Sepia
2023-04-08 18:52:22 Info [ ] Grayscale
2023-04-08 18:52:22 Info [ ] Invert colors
2023-04-08 18:52:22 Info [ ] Watermark
2023-04-08 18:52:22 Info Filename Mask: %F (Copia)
2023-04-08 18:52:22 Info [x] Resolution: 300
2023-04-08 18:52:22 Info [X] Keep Quality
2023-04-08 18:52:22 Info Quality: 90%
2023-04-08 18:52:22 Info Colors: Automatic
2023-04-08 18:52:22 Info Format: As Original
2023-04-08 18:52:22 Info Policy: Always
2023-04-08 18:52:22 Info Filtering: Cubic
2023-04-08 18:52:22 Info Mode: Fit
2023-04-08 18:52:22 Info Height: 0,96 (cm)
2023-04-08 18:52:22 Info Width: 2,80 (cm)
2023-04-08 18:52:22 Info Profile: APULIA
2023-04-08 18:52:22 Info [X] Multithread processing: Auto
2023-04-08 18:52:22 Info [X] Create backups of original files
2023-04-08 18:52:22 Info [ ] Show preview
2023-04-08 18:52:22 Info Available threads: 8
2023-04-08 18:52:20 Info Paramstr #03 : "/run"
2023-04-08 18:52:20 Info Paramstr #02 : "/profile=APULIA"
2023-04-08 18:52:20 Info Paramstr #01 : "E:\Arxivar_data\Doc\Archive_2023\04\08\18\259d0cffb36d4dd8a4760bd7c9cdc216.jpg"
2023-04-08 18:52:20 Info Paramstr #00 : "C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe"
2023-04-08 18:52:20 Info CPU: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
2023-04-08 18:52:20 Info Memory: 64,00 GB
2023-04-08 18:52:20 Info Screen DPI : 96
2023-04-08 18:52:20 Info Screen resolution : 1280 x 800, 32 bit
2023-04-08 18:52:20 Info System default language : Italiano (Italia)
2023-04-08 18:52:20 Info User default language : Italiano (Italia)
2023-04-08 18:52:20 Info Version : 6.1.6.0
2023-04-08 18:52:20 Info ExeName : C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe
2023-04-08 18:52:20 Info OS : Windows 10 Server Datacenter (full installation) Datacenter (Version 1809, Build 17763)
2023-04-08 18:52:20 ---- ******************** Log session start 2023-04-08 18:52:20.690 PID 23784********************

Where I am wrong?
the version of resize is 6.1.6.0
User avatar
Phil
ObviousIdea
Posts: 305
Joined: Wed Mar 16, 2011 11:51 pm
Contact:

Re: Problems with batch file

Post by Phil »

Hi Donato,

it looks like there is a problem with launch parameters:
2023-04-08 19:02:39 Info Paramstr #00 : "C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe"
If this is the last entry in the log, it means that no parameters were passed to LIR. Are you
executing the same batch file from another program, or the command line directly?
Are there any error messages displayed in LIR?
Donato
Junior Member
Posts: 2
Joined: Sat Apr 08, 2023 7:11 pm

Re: Problems with batch file

Post by Donato »

Hi Phil thanks for your answer

my batch is resize.bat and the content is shown in next row

"C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\resize.exe" "C:\ArxivarNext\Setup\Batch\259d0cffb36d4dd8a4760bd7c9cdc216.jpg" /profile=APULIA /run

if I run this batch from cmd or in windows clicking on the .bat name it run prefectly and thi is the relative log
2023-04-10 12:42:00 ---- ******************** Log session stop 2023-04-10 12:42:00.328 PID 32156********************
2023-04-10 12:42:00 Info Space saved: 2,70 KB (-36,81%)
2023-04-10 12:42:00 Info 1 image processed in 00:00:01.
2023-04-10 12:42:00 Info Saved as "C:\ArxivarNext\Setup\Batch\259d0cffb36d4dd8a4760bd7c9cdc216 (Copia).jpg"
2023-04-10 12:42:00 Info Resizing "C:\ArxivarNext\Setup\Batch\259d0cffb36d4dd8a4760bd7c9cdc216.jpg" [JPG] from 307x192 to 181x113
2023-04-10 12:42:00 Info 1 files
2023-04-10 12:42:00 Info --- Processing ---
2023-04-10 12:42:00 Info Destination: <original>
2023-04-10 12:42:00 Info Action: Create copies
2023-04-10 12:42:00 Info [ ] Remove background
2023-04-10 12:42:00 Info [ ] JPEG compression optimization
2023-04-10 12:42:00 Info [ ] Optimize PNG files with OptiPNG
2023-04-10 12:42:00 Info [ ] Split into parts
2023-04-10 12:42:00 Info [ ] Send by email
2023-04-10 12:42:00 Info [ ] Customize Metadata
2023-04-10 12:42:00 Info [X] Copy ICC
2023-04-10 12:42:00 Info [X] Copy IPTC
2023-04-10 12:41:59 Info [X] Copy XMP
2023-04-10 12:41:59 Info [X] Copy EXIF
2023-04-10 12:41:59 Info On name conflict: Overwrite
2023-04-10 12:41:59 Info [ ] Keep file date
2023-04-10 12:41:59 Info [ ] Adjust portrait
2023-04-10 12:41:59 Info [ ] Flip image
2023-04-10 12:41:59 Info [ ] Rotate image
2023-04-10 12:41:59 Info [ ] Round edges
2023-04-10 12:41:59 Info [ ] Contrast
2023-04-10 12:41:59 Info [ ] Brightness
2023-04-10 12:41:59 Info [ ] Auto enhance
2023-04-10 12:41:59 Info [ ] Add border
2023-04-10 12:41:59 Info [ ] Sepia
2023-04-10 12:41:59 Info [ ] Grayscale
2023-04-10 12:41:59 Info [ ] Invert colors
2023-04-10 12:41:59 Info [ ] Watermark
2023-04-10 12:41:59 Info Filename Mask: %F (Copia)
2023-04-10 12:41:59 Info [x] Resolution: 300
2023-04-10 12:41:59 Info [X] Keep Quality
2023-04-10 12:41:59 Info Quality: 90%
2023-04-10 12:41:59 Info Colors: Automatic
2023-04-10 12:41:59 Info Format: As Original
2023-04-10 12:41:59 Info Policy: Always
2023-04-10 12:41:59 Info Filtering: Cubic
2023-04-10 12:41:59 Info Mode: Fit
2023-04-10 12:41:59 Info Height: 0,96 (cm)
2023-04-10 12:41:59 Info Width: 2,80 (cm)
2023-04-10 12:41:59 Info Profile: APULIA
2023-04-10 12:41:59 Info [ ] Multithread processing
2023-04-10 12:41:59 Info [ ] Create backups of original files
2023-04-10 12:41:59 Info [ ] Show preview
2023-04-10 12:41:59 Info Available threads: 8, used: 1
2023-04-10 12:41:58 Info Paramstr #03 : "/run"
2023-04-10 12:41:58 Info Paramstr #02 : "/profile=APULIA"
2023-04-10 12:41:58 Info Paramstr #01 : "C:\ArxivarNext\Setup\Batch\259d0cffb36d4dd8a4760bd7c9cdc216.jpg"
2023-04-10 12:41:58 Info Paramstr #00 : "C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe"
2023-04-10 12:41:58 Info CPU: Intel(R) Xeon(R) Gold 6130 CPU @ 2.10GHz
2023-04-10 12:41:58 Info Memory: 64,00 GB
2023-04-10 12:41:58 Info Screen DPI : 96
2023-04-10 12:41:58 Info Screen resolution : 1280 x 800, 32 bit
2023-04-10 12:41:58 Info System default language : Italiano (Italia)
2023-04-10 12:41:58 Info User default language : Italiano (Italia)
2023-04-10 12:41:58 Info Version : 6.1.6.0
2023-04-10 12:41:58 Info ExeName : C:\Program Files (x86)\ObviousIdea\Light Image Resizer 6\Resize.exe
2023-04-10 12:41:58 Info OS : Windows 10 Server Datacenter (full installation) Datacenter (Version 1809, Build 17763)
2023-04-10 12:41:58 ---- ******************** Log session start 2023-04-10 12:41:58.448 PID 32156********************

If I try to run it in a my procedure ( the same resize.bat) it doesn't seem to run and now it doesn't write any row in the log file

Is there a way to debug the resize to figure out where it crashes?
It's very important for the application I'm developing to solve this problem
Thanks a lot
User avatar
Phil
ObviousIdea
Posts: 305
Joined: Wed Mar 16, 2011 11:51 pm
Contact:

Re: Problems with batch file

Post by Phil »

You don't see any error messages in the interface either?

If the batch file is just this single line, the issue is maybe with the way you are launching that batch. In my tests it works fine at least.
Post Reply