carol.gimp.org

gimp2

Python:JPEG Comment

python

This sub-routine reads a text file and writes it to a jpeg when saving.

image comment sub-routine

File   Edit   Search   Preferences


# opens the file at comment location and sends that off 
# with the image, the image name and the comment to be saved
    comment_file = open(image_comment_location)
    comment_text = comment_file.read().strip()
    comment_file.close()
    save_jpeg(image, name, comment)

# saves the gimp image at name with the text comment file included 
def save_jpeg(image, name, comment=""):
    jpeg_save_defaults = (0.75, 0.0, 1, 0, "", 1, 0, 0, 0)
    args = list(jpeg_save_defaults)
    args[4] = comment

    pdb.file_jpeg_save(image, image.active_layer, name, name, *args)



# this gets added to the registery and the new variable name should be 
# added in that first defined procedure. 
        (PF_FILE, "image_comment_location", "Image parasite message.", ""),
  

another-gnu-type

Most all of my software is gnu. thanks!

Valid XHTML 1.1!

CC-GNU GPL
This software is licensed under the CC-GNU GPL.