![]() ![]() Page_margins = photobook_layout.get_page_margins() # flip the images on the current page horizontally # either create a new album document, or re-layout the entire existing document SetScaleImageToFrame(scaletoframe=1, proportional=1, name=f) NewDocument(PAPER_LETTER, page_margins_points, LANDSCAPE, 1, UNIT_POINTS, PAGE_2, FACINGPAGES, FIRSTPAGERIGHT) ![]() # it seems that you _have_ to specify page margins in points # When finished, process the document to layout the images in a "nice" mannerĭirname = fileDialog("Select Directory","","",False,False,True) # Create a new document with all jpg files from the selected directory added as images # Prompt the user for a directory to process. # re-layout all pages from the current page to the end of the documentįor i in range(currentPage(), pageCount()+1): # layouts for different numbers of portrait and landscape images Nl = len(land) # number of landscape images Np = len(port) # number of portrait images # refine it to lists of landscape & portrait images # get all of the images on this page and sort them by position # Nicely layout all of the images on the current page # refine it to a list of only image objects # returns a list of the image objects on the current page Ypos = (page_height * y_place) + page_margins - obj_size/2 Xpos = (page_width * x_place) + page_margins - obj_size/2 Page_height = page_size - page_margins - page_margins Page_width = page_size - page_margins - page_margins # x_place, y_place: 0.0 - 1.0 centre position, normalized to page size # move obj to specified position and specified size # compare 2 image objects to sort by horizontal locĭef placeobj(obj_size, x_place, y_place, obj): Print "This script only runs from within Scribus." Print "This script requires the Python Image Library" # There are some auxilliary scripts that just allow you to directly invoke some of the functions in this script. # and (b) the sizes and positions look good on the page. # with the size & positions in pb_layout_page() so that (a) the image frames are the correct aspect ratio, # To change these, change the constants at the top for the paper size, then you'll need to just fiddle # This is designed for Letter pages in Landscape orientation, with images that are 3:2 aspect ratio (DSLR) # Developed on a Windows machine running Scribus 1.3.3.9 # Requires the Python Image Library from (to work out image orientation) It lays out landscape and portrait images neatly. You can move the images from page to page, and have # and lay images out on the pages in a nice way. It can both create a photobook from a folder full of images, Photobook_layout.py #!/usr/bin/env python Do your layout on the small images, then copy the large original images into the right place only for final export or printing. I found that Scribus spat the dummy at around 150 8mp images at PDF export time.Ĭreate small copies of your images. If you have a lot of images, pre-arrange them into separate subdirectories and create separate documents for "chapters". pb_flip_h.py and pb_flip_v.py will flip arrangement of images on the current page. pb_layout_from_current.py will lay out all pages from the current one to the end of the document. pb_layout_current.py will lay out only the current page. The script can handle 1-4 photos per page, in any combination of portrait and landscape. Re-running the photobook_layout.py script will go through all of the pages, re-laying them out. You can then re-arrange the photos, dragging them from page to page to get a nice layout. It will then go through each page, re-orienting and resizing the photos to nicely fit the page. The script will then add all JPEG files (*.jpg) to a new document, 3 to a page. Running photobook_layout.py without an open document will bring up a dialog to select a directory. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |