![]() It may be best overall to use the -I switch anyway, as that way you can retain the normal resources, and only use this modified code when you want to do this task. Or again you can use the -I switch to tell Ghostscript to use a set of modified resources. If Ghostscript is not built to use a ROM file system then you need to locate the resources on disk, and modify that file. If the resources are built into a ROM file system, then you will need to locate the copy stored on disk, modify the file, and then either rebuild Ghostscript so that the modified file is built into the ROM file system, or use the -I switch to tell Ghostscript to ignore the ROM file system and read the resources form a location on disk. How you use this depends on how your Ghostscript has been built, which may depend on the package maintainer for your Linux distribution. Which will prevent the if clause from executing (by pop'ping the boolean from the stack and replacing it with a 'false') so the rotation will not take place.įor me this does not rotate your landscape pages. HWMargins for the page portrait/landscape orientationħ index aload pop 3 -1 roll sub 3 1 roll exch sub exchġ0 index /Rotate pget not ifġ index 0 translate 90 rotate % add in a rotation At around line 2094 we see: currentpagedevice /.HWMargins get aload popĬurrentpagedevice /PageSize get aload pop As written the script has to be in the current directory, this can be changed.In /ghostpdl/Resource/Init/pdf_main.ps at around line 2086 is the routine pdf_PDF2PS_matrix which does the scaling.BAT syntax, for Bash (Linux,OSX) swap the simple and double quotes. Gimp -idf -batch-interpreter python-fu-eval -b "import sys sys.path=+sys.path import convertXCF n('/path/to/the/directory')" -b "pdb.gimp_quit(1)" Save as convertXCF.py (this is Python, so mind the indentation).Print "Running as _main_ with args: %s" % sys.argv Print "Finished, total processing time: %.2f seconds" % (end-start) Print "Running on directory \"%s\"" % directoryįor infile in glob.glob(os.path.join(directory, '*.xcf')): Pdb.file_png_save(image,savedlayer,outfile, outfile,True,9,True,True,True,True,True) Savedlayer = pdb.gimp_layer_new_from_visible(image,image,"Saved image") # The API saves a layer, so make a layer from the visible image Image = pdb.gimp_xcf_load(0,infile,infile) XCF in the directory passed as a parameter #!/usr/bin/python Thanks to patdavid at for the original script. Tested working with Gimp v2.10.18 on Kubuntu 20.04. (gimp-message-set-handler 1) Messages to standard outputĮcho "(convert-xcf-png \"$i\" \"$.png\")" (file-png-save2 RUN-NONINTERACTIVE image drawable outpath outpath 0 9 0 0 0 0 0 0 0) # Invoke The GIMP with Script-Fu convert-xcf-png It does not require any installation in script directories: #!/bin/bash It should work on any Linux computer with Gimp installed. The PHP Imagick extension supports SVG rendering, however the same considerations as for the regular ImageMagick apply. Likewise, if ImageMagick is < 7.0.9-25, then Inkscape must also be < 1.x.x. Here is a self-contained bash script that should convert all xcf files in your current directory into png format copies. To prevent thumbnail creation errors with ImageMagick, if its 7.0.9-25, then Inkscape must also be 1.x.x. Does anybody know the right calls/arguments to read xcf and write png? I found a script that converts some other file types ( ) but don't quite have the knowledge to modify it. My last hope is to write a batch convert script that will work in the latest version of Gimp itself, but I don't have any experience with ScriptFu. I tried the xcf2png command line tool and it gives me the message "Warning: XCF version 11 not supported (trying anyway.)" before creating an empty image. I tried using IMageMagick mogrify and convert, but they both give me "memory allocation failed" - perhaps they also don't understand the new format? I used to do this using IrfanView, but that no longer works because it refuses to open the latest version of. I've tried a few approaches that haven't worked: xcf format, and I would like to batch convert them to a more convenient format. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |