Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
scripts for comics trip
#4
(06-10-2023, 12:38 AM)jacques_duflos Wrote: I made it with chatgpt, it's the first time I use it to program, and I'm impressed.

Me, somewhat less so... looks like the intern's code  Rolleyes
  • glob.glob() does the filtering and returns the list of files with full paths: for instance glob.glob('Screenshots/*.png') returns ['Screenshots/OldStyle.png', 'Screenshots/MapObjectPlaneAxis.png'] and this would avoid some file name tinkering
  • duplicating the image is somewhat wasteful, saving the result of a layer-new-from-visible is sufficient: pdb.gimp_file_save(image,  pdb.gimp_layer_new_from_visible(image, image, "## saved"), '/tmp/foo.png','/tmp/foo.png')
  • catching an exception to bury it with a pass is heinous. Good luck if you can't create the directory.
Reply


Messages In This Thread
scripts for comics trip - by jacques_duflos - 05-11-2023, 08:11 PM
RE: scripts for comics trip - by Ofnuts - 05-11-2023, 09:25 PM
RE: scripts for comics trip - by jacques_duflos - 06-10-2023, 12:38 AM
RE: scripts for comics trip - by Ofnuts - 06-10-2023, 07:23 AM
RE: scripts for comics trip - by jacques_duflos - 06-10-2023, 08:27 PM
RE: scripts for comics trip - by Ofnuts - 06-10-2023, 09:13 PM

Forum Jump: