the command in my code is actually
gimp obviously passes that to
when a tiff is recognized.
I use this tiny-scheme to convert open jpg ,work some magic on it (adding the outline as path, removing unecessary space and changing the color profil) and then saving it as tiff. The brackets might not match because i snipped the code.
Code:
(define (jpg-to-tiff pattern)
(let* (
(filelist (cadr (file-glob pattern 1)))
)
(while (not (null? filelist))
(let* (
(theFilenameIn (car filelist))
(theImage (car (gimp-file-load RUN-NONINTERACTIVE theFilenameIn "")))
(theDrawable (car (gimp-image-get-active-drawable theImage)))
(theColor1 (car (gimp-image-pick-color theImage theDrawable 200 1 FALSE FALSE 0)))
(theColor2 (car (gimp-image-pick-color theImage theDrawable 1 1 FALSE FALSE 0)))
(theXresolution (- (car (gimp-image-get-resolution theImage)) 1))
(test (unbreakupstr (reverse (cdr (reverse (strbreakup theFilenameIn ".")))) "."))
(theFilenameOut (string-append test ".tif"))
)
.
.
.
(theDrawable2 (car (gimp-image-get-active-drawable theImage)))
(theLayer2 (car (gimp-image-get-active-layer theImage)))
)
(plug-in-autocrop 1 theImage theDrawable2)
(gimp-layer-flatten theLayer2)
(plug-in-icc-profile-apply RUN-NONINTERACTIVE theImage "eciRGB_v2.icc" COLOR-RENDERING-INTENT-PERCEPTUAL FALSE)
(file-tiff-save RUN-NONINTERACTIVE theImage theDrawable2 theFilenameOut theFilenameOut 1)
(gimp-image-delete theImage)
(set! filelist (cdr filelist))
)
)
)
)
)
)
these files should then be uploaded to an external hosted file server, that renders various formats and a thumbnail picture. But this conversion fails.
I have a second script that checks the files for certain technical details and sorts them into folders, this time in python (I got tired of the brackets):
Code:
def bilder_check(file_name):
print(file_name)
image = pdb.gimp_file_load(file_name, file_name)
drawable = pdb.gimp_image_get_active_layer(image)
has_alpha = pdb.gimp_drawable_has_alpha(drawable)
width = pdb.gimp_image_width(image)
height = pdb.gimp_image_height(image)
xresolution, yresolution = pdb.gimp_image_get_resolution(image)
num_vectors, vector_ids = pdb.gimp_image_get_vectors(image)
vectors = pdb.gimp_image_get_vectors_by_name(image, "Freisteller")
num_strokes, stroke_ids = pdb.gimp_vectors_get_strokes(vectors)
.
.
.
This one fails with the above mentioned error message on files that got processed by the first script. It works well with any other file.
I could recover the files with imagemagick mogrify. It could process the images but throwed some warnings as mentioned by rich.
The exact same behavior occurs when saving a tiff from the UI with "layers" checked.