Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RuntimeError when using PhotoLab CurveBatch script in GIMP
#1
I am trying to use the PhotoLab Curve Batch script in GIMP to apply a curve to a batch of images in a folder. However, I am getting a "RuntimeError: 実行時エラー" error when running the script in certain folders, but it works fine in other folders.
Details:
  • GIMP version: 2.10

  • Script version: 2.0

  • Operating system: Windows 10

  • Error message:
Code:
Traceback (most recent call last):
 File "C:\Users\xxx\AppData\Local\Programs\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 741, in response
   dialog.res = run_script(params)
 File "C:\Users\xxx\AppData\Local\Programs\GIMP 2\lib\gimp\2.0\python/gimpfu.py", line 362, in run_script
   return apply(function, params)
 File "C:\Users\xxx\AppData\Roaming\GIMP\2.10\plug-ins\photolab_curvebatch.py", line 150, in python_fu_curvebatch_xtns
   process_files( filepathnames, curvefilename );
 File "C:\Users\xxx\AppData\Roaming\GIMP\2.10\plug-ins\photolab_curvebatch.py", line 126, in process_files
   pdb.gimp_curves_spline( imglayer, HISTOGRAM_RED, len(icurvered), icurvered )
RuntimeError: 実行時エラー

  • The script works fine in some folders, but not in others.

  • The files in the problematic folders are all JPEG images.

  • I have tried changing the curve file, but the error persists.
Questions:
  1. What could be the cause of this error?

  2. How can I fix this error?
Additional information:
  • I have attached a sample image from the problematic folder.
I would appreciate any help in resolving this issue.
Thank you.


Attached Files Image(s)
   
Reply
#2
The image you posted is grayscale (as in Image > Mode > Grayscale). So it only has a single Gray channel, and no R/G/B channels. Therefore the script code that explicitly sets color channels can't work.

   
Reply
#3
It is amazing that photolab_curvebatch.py works at all. A tribute to backwards compatibility.

This from the version I have archived. 
# Version 3.0
# - ported to new curve format used in GIMP-2.6


Then Gimp 2.10 came along and the format changed again. This comparing the same curve Gimp 2.8 <> Gimp 2.10

   

As a note: for Gimp 2.10 then the batch plugin BIMP version 2.x uses the newer format. If you have older curve files then the legacy BIMP 1.8 uses the old style format.
Reply
#4
(03-04-2024, 10:36 AM)Ofnuts Wrote: The image you posted is grayscale (as in Image > Mode > Grayscale). So it only has a single Gray channel, and no R/G/B channels. Therefore the script code that explicitly sets color channels can't work.

Thank you for your response.
I understand that the script is currently designed to work with RGB channels and cannot apply curves to grayscale images. I appreciate you pointing out the issue and providing a detailed explanation.
I am interested in exploring the possibility of modifying the script to support the value channel instead of RGB channels. This would allow me to apply curves to grayscale images and achieve the desired tonal adjustments.
I will investigate the necessary changes to the script. 
Thank you again for your help and guidance.

(03-04-2024, 11:22 AM)rich2005 Wrote: It is amazing that photolab_curvebatch.py works at all. A tribute to backwards compatibility.

This from the version I have archived. 
# Version 3.0
# - ported to new curve format used in GIMP-2.6


Then Gimp 2.10 came along and the format changed again. This comparing the same curve Gimp 2.8 <> Gimp 2.10



As a note: for Gimp 2.10 then the batch plugin BIMP version 2.x uses the newer format. If you have older curve files then the legacy BIMP 1.8 uses the old style format.

Thank you for your information.

I want to clarify that the curve file I am using was created in GIMP 2.10, so it should be using the latest format. Therefore, I believe that the issue is not with the curve file itself, but rather with the script's handling of grayscale images.

Thank you again for your help and guidance.
Reply
#5
If you do have further problems with the script, try BIMP a batch plugin

https://www.alessandrofrancesconi.it/projects/bimp/

This will use a saved Gimp 2.10 curve file and works with both RGB or GS images.

   
Reply


Forum Jump: