From c6d7418ace434c54a373baceac538211ad11f62c Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Sun, 11 Oct 2009 11:47:40 -0700 Subject: Initial checkin. --- COPYING | 674 ++++++++++++++++++++++++++++++++++++++++++++ README | 46 +++ exifilm.glade | 552 ++++++++++++++++++++++++++++++++++++ exifilm.gladep | 8 + exifilm.py | 383 +++++++++++++++++++++++++ lfrecord.ps | 781 +++++++++++++++++++++++++++++++++++++++++++++++++++ lfrecord.py | 863 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ printrecord.py | 187 +++++++++++++ 8 files changed, 3494 insertions(+) create mode 100644 COPYING create mode 100644 README create mode 100644 exifilm.glade create mode 100644 exifilm.gladep create mode 100644 exifilm.py create mode 100644 lfrecord.ps create mode 100644 lfrecord.py create mode 100644 printrecord.py diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..94a9ed0 --- /dev/null +++ b/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README b/README new file mode 100644 index 0000000..0da7aa4 --- /dev/null +++ b/README @@ -0,0 +1,46 @@ +INTRODUCTION: + +ExiFilm is a suite of programs that can be used to annotate digital +images with information about the film exposure used to create them. +In particular, it is designed for use with large format film cameras +where the photographer may then scan the film to create a digital copy +for a library or for digital processing. + +By storing the exposure metadata in EXIF tags of scanned images, the +photographer can have electronic access to the same information +contained in the written record from the field from within an image +viewer. Further processing of the data can be done without the need +to store the metadata in a separate database. + +THE PROGRAMS: + +The file "lfrecord.ps" is a PostScript file that can be printed on US +letter paper (or other sizes). It is a single page of four exposure +record forms design for large format photography. The author trims +the four forms and binds them together as a notepad to take into the +field. The PostScript program is hand-written and can be altered +fairly easily. + +The Python program "exifilm.py" provides a data entry screen similar +to the form in "lfrecord.ps". It takes an optional argument of a path +to a directory with JPEG image files. It will provide a drop-down +list of JPEG files in the directory, and selecting one of the files +will load the EXIF information from that file. In this way it allows +the user to quickly enter metadata for a number of scanned film +images. The metadata are saved immediately upon loading a new file or +exiting the program. + +The Python program "printrecord.py" loads the metadata previously +entered with "exifilm.py" and produces pages similar to those in +"lfrecord.ps" with the metadata typeset into the fields. The +resulting file may then be printed and bound into a photo archive with +the original film. Example usage: + + python printrecord.py /path/to/images 1 16 | lpr + +Produces four pages of output including the metadata for image IDs 1 +through 16. + + +James E. Blair +October, 2009 diff --git a/exifilm.glade b/exifilm.glade new file mode 100644 index 0000000..7ae4660 --- /dev/null +++ b/exifilm.glade @@ -0,0 +1,552 @@ + + + + + + True + ExiFilm + 400 + 500 + + + + + True + + + True + 5 + 5 + + + True + File: + + + False + False + 0 + + + + + True + + + + 1 + + + + + False + False + 0 + + + + + True + + + False + False + 1 + + + + + True + 5 + 4 + 6 + 5 + 5 + + + True + True + + 6 + + + 1 + 2 + 1 + 2 + + + + + + True + True + + 6 + + + 1 + 3 + 3 + 4 + + + + + + True + True + + 6 + + + 3 + 5 + 3 + 4 + + + + + + True + True + + 4 + + + 2 + 4 + 1 + 2 + + + + + + True + True + + 4 + + + 4 + 5 + 1 + 2 + + + + + + True + ID + + + GTK_FILL + + + + + + True + Film + + + 1 + 2 + GTK_FILL + + + + + + True + Carrier + + + 2 + 4 + GTK_FILL + + + + + + True + Process + + + 4 + 5 + GTK_FILL + + + + + + True + Front Movement + + + 5 + 6 + GTK_FILL + + + + + + True + Rear Movement + + + 5 + 6 + 2 + 3 + GTK_FILL + + + + + + True + Lens + + + 2 + 3 + GTK_FILL + + + + + + True + Aperture + + + 1 + 3 + 2 + 3 + GTK_FILL + + + + + + True + Shutter + + + 3 + 5 + 2 + 3 + GTK_FILL + + + + + + True + True + + 4 + + + 1 + 2 + + + + + + True + True + + 4 + + + 3 + 4 + + + + + + None + True + True + True + + + + 5 + 6 + 1 + 2 + + + + + None + True + True + True + + + + 5 + 6 + 3 + 4 + + + + + False + False + 2 + + + + + True + + + False + 3 + + + + + True + 5 + 2 + 2 + 5 + 5 + + + True + 0 + Description: + + + GTK_FILL + + + + + True + 0 + Date: + + + 1 + 2 + GTK_FILL + + + + + True + True + + + + 1 + 2 + + + + + True + start + + + True + True + True + + + + False + False + 0 + + + + + 1 + 2 + 1 + 2 + + + + + False + False + 4 + + + + + True + + + False + 5 + + + + + True + True + 5 + automatic + automatic + + + True + True + + + + + 6 + + + + + + + 5 + normal + False + + + True + vertical + 2 + + + True + True + 2009 + 4 + 27 + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + True + + + False + False + 0 + + + + + gtk-ok + 1 + True + True + True + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + + 5 + normal + False + + + True + vertical + 2 + + + True + True + + + 1 + + + + + True + end + + + gtk-cancel + True + True + True + True + + + False + False + 0 + + + + + gtk-ok + 1 + True + True + True + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + diff --git a/exifilm.gladep b/exifilm.gladep new file mode 100644 index 0000000..407c797 --- /dev/null +++ b/exifilm.gladep @@ -0,0 +1,8 @@ + + + + + Exifilm + exifilm + FALSE + diff --git a/exifilm.py b/exifilm.py new file mode 100644 index 0000000..17db62d --- /dev/null +++ b/exifilm.py @@ -0,0 +1,383 @@ +#!/usr/bin/python + +# ExiFilm -- Add film exposure metadata to EXIF tags of digital images +# Copyright (C) 2009 James E. Blair +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import pygtk +pygtk.require('2.0') +import gtk, gobject +import gtk.glade +import gtk.keysyms +from gtk import gdk + +import os, sys +import pyexiv2 +import datetime +import decimal, fractions +import re + +HALF_STOP_SCALE = ['1', '1.2', '1.4', '1.7', '2', '2.4', '2.8', '3.3', '4', '4.8', + '5.6', '6.7', '8', '9.5', '11', '13', '16', '19', '22', '27', + '32', '38', '45', '54', '64', '76', '91'] + + +THIRD_STOP_SCALE = ['1', '1.1', '1.2', '1.4', '1.6', '1.8', '2', '2.2', '2.5', + '2.8', '3.2', '3.5', '4', '4.5', '5.0', '5.6', '6.3', '7.1', + '8', '9', '10', '11', '13', '14', '16', '18', '20', '22', + '25', '29', '32', '36', '40', '45', '51', '57', '64', '72', + '81', '91'] + +CAMERA_MOVEMENTS = [ + 'rising', + 'falling', + 'forward tilt', + 'backward tilt', + 'left shift', + 'right shift', + 'left swing', + 'right swing', + ] + +ID = 'ID' +FILM = 'Film' +CARRIER = 'Carrier' +PROCESS = 'Process' +FRONT_MOVEMENTS = 'Front movements' +REAR_MOVEMENTS = 'Rear movements' + +PRIVATE_KEYS = [ + ID, + FILM, + CARRIER, + PROCESS, + FRONT_MOVEMENTS, + REAR_MOVEMENTS, + ] + +ISO_RE = re.compile(r'\d\d+') + +def to_rational(v): + if '/' in v: + n,d = v.split('/') + else: + n,d = (v,1) + return pyexiv2.Rational(int(n), int(d)) + +def from_rational(v): + if not v: return v + n,d = str(v).split('/') + if d == '1': + return str(n) + return str(v) + +def from_fstop(v): + if '/' in v: + whole, frac = v.split(' ') + n,d = frac.split('/') + if d == '2': scale = HALF_STOP_SCALE + if d == '3': scale = THIRD_STOP_SCALE + i = scale.index(whole) + i += int(n) + f = fractions.Fraction.from_decimal(decimal.Decimal(str(scale[i]))) + return str(f) + f = fractions.Fraction.from_decimal(decimal.Decimal(v)) + return str(f) + +def to_fstop(v): + if '/' in v: + n,d = v.split('/') + return str(float(n)/float(d)) + return v + +def encode_comments(d, comments): + ret = '' + for k in PRIVATE_KEYS: + if k in d.keys(): + ret += '%s: %s\n' % (k, d[k]) + ret += '\n'+comments + return ret + +def decode_comments(comments): + d = {} + ret = '' + lines = comments.split('\n') + while lines: + line = lines.pop(0).strip() + if not line: break + if ':' in line: + k,v = line.split(':', 1) + d[k.strip()] = v.strip() + else: + ret += line+'\n' + break + return d, ret+'\n'.join(lines) + +class ExiFilm(object): + + def __init__(self): + self.image = None + self.xml = gtk.glade.XML('exifilm.glade', 'main_window') + + self.file_combo = self.xml.get_widget('file') + + self.id_entry = self.xml.get_widget('id') + self.film_entry = self.xml.get_widget('film') + self.carrier_entry = self.xml.get_widget('carrier') + self.process_entry = self.xml.get_widget('process') + self.lens_entry = self.xml.get_widget('lens') + self.aperture_entry = self.xml.get_widget('aperture') + self.shutter_entry = self.xml.get_widget('shutter') + + self.front_button = self.xml.get_widget('front') + self.rear_button = self.xml.get_widget('rear') + + self.description_entry = self.xml.get_widget('description') + self.date_button = self.xml.get_widget('date') + + self.comments_text = self.xml.get_widget('comments') + self.comments_buffer = gtk.TextBuffer() + self.comments_text.set_buffer(self.comments_buffer) + + # Keep the last selected date to provide a sane default + self.lastdate = None + + dic = { + 'on_main_window_destroy': self.window_closed, + 'on_main_window_key_press_event': self.key_press, + 'on_date_clicked': self.date_clicked, + 'on_front_clicked': self.front_clicked, + 'on_rear_clicked': self.rear_clicked, + 'on_file_changed': self.file_changed, + } + + self.xml.signal_autoconnect (dic) + + self.file_store = gtk.ListStore(gobject.TYPE_STRING) + cell = gtk.CellRendererText() + self.file_combo.pack_start(cell, True) + self.file_combo.add_attribute(cell, 'text', 0) + self.file_combo.set_model(self.file_store) + + self.filename = None + first = None + self.directory = '.' + if len(sys.argv)>1: + self.directory = sys.argv[1] + files = os.listdir(self.directory) + files.sort() + for fn in files: + if not (fn.lower().endswith('.jpeg') or + fn.lower().endswith('.jpg')): + continue + if not first: first = fn + self.file_store.append((fn,)) + if first: + self.file_combo.set_active(0) + + def file_changed(self, widget, data=None): + if self.filename: + self.save() + i = self.file_combo.get_active() + fn = self.file_store[i][0] + self.load(fn) + self.id_entry.grab_focus() + + def key_press(self, widget, data=None): + if data.keyval == gtk.keysyms.Page_Up: + i = self.file_combo.get_active() + if i>0: + self.file_combo.set_active(i-1) + return True + + if data.keyval == gtk.keysyms.Page_Down: + i = self.file_combo.get_active() + if i1 and sys.argv[1][0]=='-': + print "Usage: %s [PATH]" % sys.argv[0] + print + print " PATH is a directory with JPEG files to edit." + print " PATH defaults to the current directory." + else: + main() diff --git a/lfrecord.ps b/lfrecord.ps new file mode 100644 index 0000000..23153c1 --- /dev/null +++ b/lfrecord.ps @@ -0,0 +1,781 @@ +%!PS-Adobe-3.0 +%%Pages: 1 +%%BoundingBox: 0 0 612 792 +%%EndComments +%%Page: 1 1 + +% ExiFilm -- Add film exposure metadata to EXIF tags of digital images +% Copyright (C) 2009 James E. Blair +% +% This program is free software: you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation, either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . + +% User servicable: + +/in { 72 mul } def + +/cellheight 12.75 def +/plantop 9.75 in def % 8.5 - .5 in at top +/planleft 7 32 div in def +/planwidth 3 in 15 16 div in add def + +% 3 15/16 in wide +% 5 in high + +/normalfont {/Times-Roman 10 selectfont} def +/smallfont {/Times-Roman 8 selectfont} def + +/baselineskip 12 def +1 setlinewidth + +% Less user servicable: + +/planheight 21 cellheight mul def +/condtop plantop planheight sub def +/condleft planleft def +/condheight 11 cellheight mul def + +/cell {/cury curx cury wd cellht box def} def +/cell1 {curx cury wd1 cellht box pop} def +/cell2cr {/cury curx wd1 add cury wd2 cellht box def} def +/cell3cr {/cury curx wd1 add wd2 add cury wd3 cellht box def} def +/cell2 {curx wd1 add cury wd2 cellht box pop} def +/cell3 {curx wd1 add wd2 add cury wd3 cellht box pop} def +/triangle {newpath curx cury moveto 6 0 cellht 2 div sub rlineto + -6 0 cellht 2 div sub rlineto closepath fill} def + + +/toppic +{ +0 18 translate +0.8 -0.8 scale +0 0 0 setrgbcolor +[] 0 setdash +1 setlinewidth +0 setlinejoin +0 setlinecap +gsave [1 0 0 1 0 0] concat +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +17.465566 7.6270604 moveto +17.34201 7.4607341 17.023642 7.1667431 16.801411 7.0511098 curveto +16.503644 6.896187 16.307292 6.8516095 16.026569 6.7055509 curveto +15.791517 6.5832505 15.419851 6.5327667 15.14103 6.5327667 curveto +14.851109 6.5327667 14.510791 6.4751688 14.200137 6.4751688 curveto +13.906717 6.4751688 13.544314 6.6414571 13.314598 6.8207372 curveto +13.068846 7.0125432 12.874548 7.2361726 12.595099 7.4542762 curveto +12.344743 7.6496678 12.125565 7.8753705 11.930944 8.1454035 curveto +11.751845 8.3938944 11.61173 8.7253772 11.543518 9.0093151 curveto +11.483134 9.2606497 11.432821 9.6008921 11.432821 9.9308246 curveto +11.432821 10.284991 11.481859 10.646709 11.543518 10.96752 curveto +11.606347 11.294419 11.689348 11.459357 11.764903 11.773844 curveto +11.826229 12.029125 12.085382 12.337715 12.207673 12.464971 curveto +12.411225 12.676797 12.681981 12.913342 12.927172 13.040921 curveto +13.208038 13.187056 13.356056 13.321654 13.591326 13.444078 curveto +13.894704 13.60193 14.210656 13.770986 14.532219 13.904833 curveto +14.799874 14.016243 15.064115 14.020019 15.362414 14.020019 curveto +15.668037 14.020019 15.886968 14.041942 16.1926 13.962421 curveto +16.488636 13.885412 16.686938 13.733028 16.912108 13.674451 curveto +17.175607 13.605906 17.382184 13.372271 17.576263 13.271294 curveto +17.802565 13.15354 17.966257 13.038239 18.12972 12.868137 curveto +18.33059 12.659107 18.448373 12.636072 18.517146 12.349785 curveto +18.58201 12.07978 18.683187 12.005006 18.683187 11.658657 curveto +18.683187 11.370687 18.683187 11.082707 18.683187 10.794746 curveto +18.683187 10.482732 18.689036 10.243133 18.627843 9.9884225 curveto +18.56315 9.7191599 18.57249 9.4050915 18.57249 9.1245109 curveto +18.57249 8.8389752 18.46301 8.6086787 18.351105 8.3757857 curveto +18.246685 8.158462 18.001799 8.0698776 17.852991 7.9150309 curveto +17.675889 7.730729 17.748724 7.7007222 17.465566 7.6270604 curveto +closepath +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +18.908969 9.1187484 moveto +19.132586 9.2148318 19.670178 9.5204546 19.889559 9.6723899 curveto +20.225854 9.9053021 20.525329 9.9224118 20.835946 10.076851 curveto +21.210027 10.262847 21.490107 10.364636 21.849811 10.465301 curveto +22.38606 10.615383 21.920523 10.684453 21.563764 10.76915 curveto +21.276372 10.837386 20.927903 10.920113 20.619207 10.993399 curveto +20.270784 11.076118 19.970536 11.147404 19.607192 11.233666 curveto +19.449759 11.271042 19.292336 11.308417 19.134913 11.345791 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +12.479003 7.3178906 moveto +12.297483 7.2051594 10.437915 6.743884 10.199405 6.6961819 curveto +9.9461844 6.6455378 8.2389814 6.412102 8.4897064 6.4371367 curveto +8.9210134 6.4802021 7.6023054 6.3853275 7.3499064 6.3853275 curveto +7.1865764 6.3853275 6.6748094 6.3424179 6.2101074 6.3853275 curveto +5.9802984 6.4065477 4.6730454 6.5580544 4.3967904 6.6961819 curveto +4.1597714 6.8146914 3.9322444 6.8766459 3.6714644 7.0070363 curveto +3.3812444 7.1521462 3.1878204 7.2920552 2.9461374 7.4733178 curveto +2.7386724 7.6289163 2.4671594 7.8455027 2.2726194 7.9914084 curveto +2.0299164 8.1734353 1.8916084 8.3206101 1.7027194 8.5094989 curveto +1.5052674 8.706951 1.4151344 8.8256235 1.2882464 9.0793985 curveto +1.1595274 9.3368386 1.0339524 9.4843697 0.92558337 9.7011073 curveto +0.78229837 9.9876779 0.64040737 10.116486 0.56292037 10.426434 curveto +0.50396737 10.662246 0.51591437 10.873501 0.45930237 11.099952 curveto +0.39136637 11.371693 0.56233537 11.565062 0.66653837 11.77347 curveto +0.76972037 11.979834 1.0569594 12.231766 1.1846294 12.395178 curveto +1.4171204 12.692756 1.6462124 12.974507 1.9099554 13.172314 curveto +2.2042814 13.393059 2.9527384 13.952751 3.2569914 14.104877 curveto +4.1361764 14.565305 4.7738594 14.88324 5.7438264 14.985631 curveto +6.1202154 15.079729 7.3525084 15.363749 8.8005604 15.192867 curveto +9.8815834 15.065298 10.824802 14.750645 11.494631 14.260304 curveto +12.29744 13.766723 12.403624 13.534597 12.789858 13.120505 curveto +stroke +grestore +} def + +/sidepic +{ +0 18 translate +0.8 -0.8 scale +0 0 0 setrgbcolor +[] 0 setdash +1 setlinewidth +0 setlinejoin +0 setlinecap +gsave [1 0 0 1 0 0] concat +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +17.41745 3.3235764 moveto +17.28754 3.1486964 16.9528 2.8395864 16.71914 2.7180064 curveto +16.40606 2.5551164 16.19961 2.5082464 15.90445 2.3546764 curveto +15.65731 2.2260864 15.26653 2.1730064 14.97337 2.1730064 curveto +14.66854 2.1730064 14.31072 2.1124464 13.98409 2.1124464 curveto +13.67558 2.1124464 13.29454 2.2872864 13.05301 2.4757864 curveto +12.79462 2.6774564 12.59033 2.9125864 12.296511 3.1419064 curveto +12.033281 3.3473464 11.802831 3.5846564 11.598201 3.8685764 curveto +11.409891 4.1298464 11.262571 4.4783764 11.190851 4.7769164 curveto +11.127361 5.0411764 11.074461 5.3989164 11.074461 5.7458164 curveto +11.074461 6.1181964 11.126021 6.4985164 11.190851 6.8358264 curveto +11.256911 7.1795364 11.344181 7.3529564 11.423621 7.6836164 curveto +11.488101 7.9520264 11.760581 8.2764864 11.889161 8.4102864 curveto +12.103181 8.6330064 12.387861 8.8817164 12.64566 9.0158564 curveto +12.94097 9.1695064 13.0966 9.3110264 13.34397 9.4397464 curveto +13.66295 9.6057164 13.99515 9.7834664 14.33325 9.9241964 curveto +14.61467 10.041336 14.8925 10.045306 15.20614 10.045306 curveto +15.52748 10.045306 15.75767 10.068356 16.07902 9.9847464 curveto +16.39028 9.9037764 16.59878 9.7435564 16.83553 9.6819664 curveto +17.11258 9.6098964 17.32978 9.3642464 17.53384 9.2580764 curveto +17.77178 9.1342664 17.94389 9.0130364 18.11576 8.8341864 curveto +18.32696 8.6144064 18.4508 8.5901864 18.52311 8.2891764 curveto +18.59131 8.0052864 18.69769 7.9266664 18.69769 7.5625064 curveto +18.69769 7.2597264 18.69769 6.9569364 18.69769 6.6541664 curveto +18.69769 6.3261064 18.70384 6.0741864 18.6395 5.8063764 curveto +18.57148 5.5232664 18.5813 5.1930464 18.5813 4.8980364 curveto +18.5813 4.5978164 18.46619 4.3556764 18.34853 4.1108064 curveto +18.23874 3.8823064 17.98126 3.7891664 17.8248 3.6263564 curveto +17.63859 3.4325764 17.71517 3.4010264 17.41745 3.3235764 curveto +closepath +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +18.94656 5.9379964 moveto +19.1584 6.0815564 19.65288 6.5037464 19.84927 6.7041364 curveto +20.15032 7.0113264 20.45615 7.0883864 20.74625 7.3094564 curveto +21.09562 7.5756964 21.36463 7.7363464 21.716081 7.9116264 curveto +22.240021 8.1729464 21.745631 8.1519364 21.36046 8.1686364 curveto +21.05018 8.1820964 20.67396 8.1984064 20.34068 8.2128564 curveto +19.96451 8.2291664 19.64035 8.2432264 19.24807 8.2602364 curveto +19.0781 8.2676064 18.90814 8.2749764 18.73818 8.2823464 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +11.058081 6.3609964 moveto +10.898991 6.3609964 10.297991 6.3609964 9.9236506 6.3609964 curveto +9.6528706 6.3609964 9.2296906 6.4606964 9.0019306 6.5275864 curveto +8.6792106 6.6223764 8.3901106 6.6031664 8.0802106 6.6941864 curveto +7.7549906 6.7896964 7.3425006 6.8692064 7.0875806 6.9440764 curveto +6.7203606 7.0519264 6.3784006 7.1731864 6.0240506 7.2772664 curveto +5.6876206 7.3760764 5.4495006 7.5314764 5.1732306 7.6937564 curveto +4.8089906 7.9077164 4.5570206 8.1390264 4.1806106 8.3601364 curveto +3.8315206 8.5651864 3.5054206 9.0700664 3.2588806 9.3597064 curveto +2.9162706 9.7622164 2.6772606 10.143226 2.4789706 10.609166 curveto +2.2757806 11.086586 2.1067606 11.567026 1.9117506 12.025216 curveto +1.7229306 12.468886 1.5183906 12.957456 1.4154406 13.441276 curveto +1.3145406 13.915446 1.0273606 14.353136 0.84822058 14.774036 curveto +0.65579058 15.226186 0.63552058 15.643266 0.63552058 15.773606 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +14.33933 10.302876 moveto +14.20693 10.595156 14.14423 11.072806 13.90194 11.429396 curveto +13.70442 11.720106 13.37015 12.016406 13.17297 12.234056 curveto +12.88897 12.547546 12.59356 12.873636 12.298201 13.199656 curveto +12.020021 13.506716 11.823431 13.804186 11.496341 14.165246 curveto +11.169801 14.525686 10.912571 14.749106 10.548671 15.050376 curveto +10.232431 15.312176 9.7936806 15.426826 9.4552106 15.613636 curveto +9.1243106 15.796266 8.5739906 15.756236 8.2159606 15.855036 curveto +7.8258106 15.962696 7.3481706 15.832996 6.9767106 15.935496 curveto +6.5954506 16.040716 6.0587306 15.935496 5.6645506 15.935496 curveto +5.2171706 15.935496 4.8659706 16.015966 4.4253006 16.015966 curveto +4.0136906 16.015966 3.5635006 15.935496 3.1131506 15.935496 curveto +2.7207406 15.935496 2.2370206 15.733586 2.0196906 15.613636 curveto +1.7663706 15.473826 1.1338906 15.325916 1.0720306 15.291776 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.63630593 setlinewidth +1 setlinejoin +1 setlinecap +newpath +9.9264619 15.524615 moveto +9.601864 15.336485 9.9988871 16.363201 9.9988871 16.783897 curveto +9.9988871 17.343824 9.8991612 17.884929 9.9988871 18.462927 curveto +10.104136 19.072974 9.9702746 19.353219 10.288574 19.722199 curveto +10.538501 20.011916 10.948726 20.272725 11.157634 20.393812 curveto +11.29979 20.476203 11.505777 20.474522 11.519735 20.477757 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +10.213238 19.68757 moveto +10.382008 19.78072 9.6081369 20.54456 9.4113669 20.65317 curveto +9.2846369 20.72311 9.1736069 20.82462 9.0468769 20.89457 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +6.5393206 16.015966 moveto +6.2133206 16.195896 6.5393206 16.820626 6.5393206 17.222956 curveto +6.5393206 17.627916 6.5393206 17.996046 6.5393206 18.429956 curveto +6.5393206 18.885926 6.5393206 19.341896 6.5393206 19.797876 curveto +6.5393206 19.821846 7.2722806 20.242636 7.3411906 20.280676 curveto +7.3483106 20.418036 7.4383906 20.334316 7.4869906 20.361136 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +6.5393206 19.797876 moveto +6.8774206 19.984476 6.0047406 20.387956 5.7374506 20.683006 curveto +5.6645606 20.763466 5.5916606 20.843936 5.5187606 20.924396 curveto +stroke +gsave +0 0 0 setrgbcolor +newpath +16.59914 4.9921064 moveto +16.75393 5.5208564 16.53852 5.6023764 16.16176 5.3944364 curveto +15.78595 5.1870264 16.27681 4.8497864 16.59914 4.9921064 curveto +closepath +fill +grestore +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +16.59914 4.9921064 moveto +16.75393 5.5208564 16.53852 5.6023764 16.16176 5.3944364 curveto +15.78595 5.1870264 16.27681 4.8497864 16.59914 4.9921064 curveto +closepath +stroke +grestore +} def + +/greybox + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + .8 .8 .8 setrgbcolor + left bottom width height rectfill + 0 0 0 setrgbcolor + left bottom width height rectstroke + bottom + } def + +/blackbox + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + 0 0 0 setrgbcolor + left bottom width height rectfill + left bottom width height rectstroke + bottom + } def + +/box + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + 0 0 0 setrgbcolor + left bottom width height rectstroke + bottom + } def + +/writingline + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + .125 setlinewidth + left bottom moveto width 0 rlineto stroke + 1 setlinewidth + bottom + } def + + +/centertext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x2 x1 sub 2 div x1 add % midpoint + s stringwidth pop 2 div % half the string width + sub % move left to start + + y baselineskip sub moveto s show + y baselineskip sub + } def + +/righttext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x2 + s stringwidth pop + sub 1 sub + + y baselineskip sub moveto s show + y baselineskip sub + } def + +/lefttext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x1 1 add + + y baselineskip sub moveto s show + y baselineskip sub + } def + + +/picid + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (ID) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/aperture + { + /cury exch def + /curx exch def + /wd 68 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Aperture (f/x)) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/shutter + { + /cury exch def + /curx exch def + /wd 68 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Shutter (sec)) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/geometry + { + /cury exch def + /curx exch def + /wd 74 def + /headht 1 cellheight mul def + /cellht 2.5 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Geometry) centertext + pop + + /cury exch def % add height change from box + + cell + + gsave curx 3 add cury 6 add translate toppic grestore + + cell + + gsave curx 3 add cury 6 add translate sidepic grestore + + xpos wd add + } def + +/film + { + /cury exch def + /curx exch def + /wd 52 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Film) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/carrier + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Carrier) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/lens + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Lens) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/process + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Process) centertext + pop + + /cury exch def % add height change from box + + cell + + xpos wd add + } def + +/date + { + /cury exch def + /curx exch def + + /wd 252 108 sub def + /cellht 1.5 cellheight mul def + + curx cury wd 2 cellht mul box pop + + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + + /cury cury 2 cellht mul add def + /curx curx wd add def + + /wd 108 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Date) centertext + pop + + /cury exch def % add height change from box + + cell + + % draw the writing lines + + xpos + } def + +/notes + { + /cury exch def + /curx exch def + /wd 252 def + %/headht 1 cellheight mul def + /cellht 1.5 cellheight mul def + /boxht 4.5 in 6 cellheight mul sub def % 5in - header so far + + %curx cury wd headht greybox + + %cury 2 add + %curx curx wd add (Process) centertext + %pop + + %/cury exch def % add height change from box + + curx cury wd boxht box pop + + %/cury curx 10 add cury wd 20 sub cellht writingline def + + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + + xpos + } def + +/record + { + /rtop exch def + /rleft exch def + + /xpos rleft def + /ypos rtop def + normalfont + /xpos xpos ypos picid def + /xpos xpos ypos film def + /xpos xpos ypos carrier def + /xpos xpos ypos process def + /xpos xpos ypos geometry def + + /ypos ypos 3 cellheight mul sub def + /xpos rleft def + + /xpos xpos ypos lens def + /xpos xpos ypos aperture def + /xpos xpos ypos shutter def + + /ypos ypos 3 cellheight mul sub def + /xpos rleft def + + %/xpos xpos ypos date def + %/ypos ypos 3 cellheight mul sub def + %/xpos rleft def + + /xpos xpos ypos notes def + } +def + +/xpos planleft def +/ypos plantop def + +planleft plantop record +planleft planwidth add plantop record +planleft plantop 5 in sub record +planleft planwidth add plantop 5 in sub record + +%/xpos planleft def +%/ypos ypos 3 cellheight mul sub def +%/xpos xpos ypos picid def +%/xpos xpos ypos aperture def +%/xpos xpos ypos shutter def +%/xpos xpos ypos geometry def + +%/xpos xpos plantop vor def +%/totalleft xpos def +%/xpos xpos plantop course def +%/xpos xpos plantop altitude def +%/xpos xpos plantop wind def +%/xpos xpos plantop airspeed def +%/xpos xpos plantop tc def +%/xpos xpos plantop th def +%/xpos xpos plantop mh def +%/xpos xpos plantop ch def +%/xpos xpos plantop dist def +%/xpos xpos plantop gs def +%/totalright xpos def +%/xpos xpos plantop time def +%/xpos xpos plantop gph def +%/planright xpos def +%totalleft totalright plantop planheight cellheight sub sub total + +%/xpos condleft def +%normalfont +%/xpos xpos condtop frequencies 1 add def +%/xpos xpos condtop atis 1 add def +%/xpos xpos condtop planright condheight layout def + +/crop +{ + gsave + .2 setlinewidth + .7 .7 .7 setrgbcolor + + /bottom plantop 8.5 72 mul sub 36 add def + + planleft 4.5 sub plantop 36 add moveto + gsave + 0 -8 rmoveto 0 16 rlineto stroke + grestore + -8 0 rmoveto 16 0 rlineto stroke + + planright 4.5 add plantop 36 add moveto + gsave + 0 -8 rmoveto 0 16 rlineto stroke + grestore + -8 0 rmoveto 16 0 rlineto stroke + + + planleft 4.5 sub bottom moveto + 0 -8 rmoveto 0 16 rlineto stroke + + planright 4.5 add bottom moveto + 0 -8 rmoveto 0 16 rlineto stroke + + grestore +} def + +%crop + +showpage + +%%EOF \ No newline at end of file diff --git a/lfrecord.py b/lfrecord.py new file mode 100644 index 0000000..b869033 --- /dev/null +++ b/lfrecord.py @@ -0,0 +1,863 @@ +# ExiFilm -- Add film exposure metadata to EXIF tags of digital images +# Copyright (C) 2009 James E. Blair +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +program = """%%!PS-Adobe-3.0 +%%%%Pages: %(pages)s +%%%%BoundingBox: 0 0 612 792 +%%%%EndComments + +%% User servicable: + +/in { 72 mul } def + +/cellheight 12.75 def +%%/plantop 9.75 in def %% 8.5 - .5 in at top +%%/planleft 7 32 div in def +/plantop 10.25 in def %% 8.5 - .5 in at top +/planleft .75 in def +/planwidth 3 in 15 16 div in add def + +%% 3 15/16 in wide +%% 5 in high + +/bigfont {/Times-Roman 14 selectfont} def +/normalfont {/Times-Roman 12 selectfont} def +/smallfont {/Times-Roman 10 selectfont} def + +/baselineskip 12 def +1 setlinewidth + +%% Less so: + +/planheight 21 cellheight mul def +/condtop plantop planheight sub def +/condleft planleft def +/condheight 11 cellheight mul def + +/cell {/cury curx cury wd cellht box def} def +/cell1 {curx cury wd1 cellht box pop} def +/cell2cr {/cury curx wd1 add cury wd2 cellht box def} def +/cell3cr {/cury curx wd1 add wd2 add cury wd3 cellht box def} def +/cell2 {curx wd1 add cury wd2 cellht box pop} def +/cell3 {curx wd1 add wd2 add cury wd3 cellht box pop} def +/triangle {newpath curx cury moveto 6 0 cellht 2 div sub rlineto + -6 0 cellht 2 div sub rlineto closepath fill} def + + +/toppic +{ +0 18 translate +0.8 -0.8 scale +0 0 0 setrgbcolor +[] 0 setdash +1 setlinewidth +0 setlinejoin +0 setlinecap +gsave [1 0 0 1 0 0] concat +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +17.465566 7.6270604 moveto +17.34201 7.4607341 17.023642 7.1667431 16.801411 7.0511098 curveto +16.503644 6.896187 16.307292 6.8516095 16.026569 6.7055509 curveto +15.791517 6.5832505 15.419851 6.5327667 15.14103 6.5327667 curveto +14.851109 6.5327667 14.510791 6.4751688 14.200137 6.4751688 curveto +13.906717 6.4751688 13.544314 6.6414571 13.314598 6.8207372 curveto +13.068846 7.0125432 12.874548 7.2361726 12.595099 7.4542762 curveto +12.344743 7.6496678 12.125565 7.8753705 11.930944 8.1454035 curveto +11.751845 8.3938944 11.61173 8.7253772 11.543518 9.0093151 curveto +11.483134 9.2606497 11.432821 9.6008921 11.432821 9.9308246 curveto +11.432821 10.284991 11.481859 10.646709 11.543518 10.96752 curveto +11.606347 11.294419 11.689348 11.459357 11.764903 11.773844 curveto +11.826229 12.029125 12.085382 12.337715 12.207673 12.464971 curveto +12.411225 12.676797 12.681981 12.913342 12.927172 13.040921 curveto +13.208038 13.187056 13.356056 13.321654 13.591326 13.444078 curveto +13.894704 13.60193 14.210656 13.770986 14.532219 13.904833 curveto +14.799874 14.016243 15.064115 14.020019 15.362414 14.020019 curveto +15.668037 14.020019 15.886968 14.041942 16.1926 13.962421 curveto +16.488636 13.885412 16.686938 13.733028 16.912108 13.674451 curveto +17.175607 13.605906 17.382184 13.372271 17.576263 13.271294 curveto +17.802565 13.15354 17.966257 13.038239 18.12972 12.868137 curveto +18.33059 12.659107 18.448373 12.636072 18.517146 12.349785 curveto +18.58201 12.07978 18.683187 12.005006 18.683187 11.658657 curveto +18.683187 11.370687 18.683187 11.082707 18.683187 10.794746 curveto +18.683187 10.482732 18.689036 10.243133 18.627843 9.9884225 curveto +18.56315 9.7191599 18.57249 9.4050915 18.57249 9.1245109 curveto +18.57249 8.8389752 18.46301 8.6086787 18.351105 8.3757857 curveto +18.246685 8.158462 18.001799 8.0698776 17.852991 7.9150309 curveto +17.675889 7.730729 17.748724 7.7007222 17.465566 7.6270604 curveto +closepath +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +18.908969 9.1187484 moveto +19.132586 9.2148318 19.670178 9.5204546 19.889559 9.6723899 curveto +20.225854 9.9053021 20.525329 9.9224118 20.835946 10.076851 curveto +21.210027 10.262847 21.490107 10.364636 21.849811 10.465301 curveto +22.38606 10.615383 21.920523 10.684453 21.563764 10.76915 curveto +21.276372 10.837386 20.927903 10.920113 20.619207 10.993399 curveto +20.270784 11.076118 19.970536 11.147404 19.607192 11.233666 curveto +19.449759 11.271042 19.292336 11.308417 19.134913 11.345791 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +12.479003 7.3178906 moveto +12.297483 7.2051594 10.437915 6.743884 10.199405 6.6961819 curveto +9.9461844 6.6455378 8.2389814 6.412102 8.4897064 6.4371367 curveto +8.9210134 6.4802021 7.6023054 6.3853275 7.3499064 6.3853275 curveto +7.1865764 6.3853275 6.6748094 6.3424179 6.2101074 6.3853275 curveto +5.9802984 6.4065477 4.6730454 6.5580544 4.3967904 6.6961819 curveto +4.1597714 6.8146914 3.9322444 6.8766459 3.6714644 7.0070363 curveto +3.3812444 7.1521462 3.1878204 7.2920552 2.9461374 7.4733178 curveto +2.7386724 7.6289163 2.4671594 7.8455027 2.2726194 7.9914084 curveto +2.0299164 8.1734353 1.8916084 8.3206101 1.7027194 8.5094989 curveto +1.5052674 8.706951 1.4151344 8.8256235 1.2882464 9.0793985 curveto +1.1595274 9.3368386 1.0339524 9.4843697 0.92558337 9.7011073 curveto +0.78229837 9.9876779 0.64040737 10.116486 0.56292037 10.426434 curveto +0.50396737 10.662246 0.51591437 10.873501 0.45930237 11.099952 curveto +0.39136637 11.371693 0.56233537 11.565062 0.66653837 11.77347 curveto +0.76972037 11.979834 1.0569594 12.231766 1.1846294 12.395178 curveto +1.4171204 12.692756 1.6462124 12.974507 1.9099554 13.172314 curveto +2.2042814 13.393059 2.9527384 13.952751 3.2569914 14.104877 curveto +4.1361764 14.565305 4.7738594 14.88324 5.7438264 14.985631 curveto +6.1202154 15.079729 7.3525084 15.363749 8.8005604 15.192867 curveto +9.8815834 15.065298 10.824802 14.750645 11.494631 14.260304 curveto +12.29744 13.766723 12.403624 13.534597 12.789858 13.120505 curveto +stroke +grestore +} def + +/sidepic +{ +0 18 translate +0.8 -0.8 scale +0 0 0 setrgbcolor +[] 0 setdash +1 setlinewidth +0 setlinejoin +0 setlinecap +gsave [1 0 0 1 0 0] concat +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +17.41745 3.3235764 moveto +17.28754 3.1486964 16.9528 2.8395864 16.71914 2.7180064 curveto +16.40606 2.5551164 16.19961 2.5082464 15.90445 2.3546764 curveto +15.65731 2.2260864 15.26653 2.1730064 14.97337 2.1730064 curveto +14.66854 2.1730064 14.31072 2.1124464 13.98409 2.1124464 curveto +13.67558 2.1124464 13.29454 2.2872864 13.05301 2.4757864 curveto +12.79462 2.6774564 12.59033 2.9125864 12.296511 3.1419064 curveto +12.033281 3.3473464 11.802831 3.5846564 11.598201 3.8685764 curveto +11.409891 4.1298464 11.262571 4.4783764 11.190851 4.7769164 curveto +11.127361 5.0411764 11.074461 5.3989164 11.074461 5.7458164 curveto +11.074461 6.1181964 11.126021 6.4985164 11.190851 6.8358264 curveto +11.256911 7.1795364 11.344181 7.3529564 11.423621 7.6836164 curveto +11.488101 7.9520264 11.760581 8.2764864 11.889161 8.4102864 curveto +12.103181 8.6330064 12.387861 8.8817164 12.64566 9.0158564 curveto +12.94097 9.1695064 13.0966 9.3110264 13.34397 9.4397464 curveto +13.66295 9.6057164 13.99515 9.7834664 14.33325 9.9241964 curveto +14.61467 10.041336 14.8925 10.045306 15.20614 10.045306 curveto +15.52748 10.045306 15.75767 10.068356 16.07902 9.9847464 curveto +16.39028 9.9037764 16.59878 9.7435564 16.83553 9.6819664 curveto +17.11258 9.6098964 17.32978 9.3642464 17.53384 9.2580764 curveto +17.77178 9.1342664 17.94389 9.0130364 18.11576 8.8341864 curveto +18.32696 8.6144064 18.4508 8.5901864 18.52311 8.2891764 curveto +18.59131 8.0052864 18.69769 7.9266664 18.69769 7.5625064 curveto +18.69769 7.2597264 18.69769 6.9569364 18.69769 6.6541664 curveto +18.69769 6.3261064 18.70384 6.0741864 18.6395 5.8063764 curveto +18.57148 5.5232664 18.5813 5.1930464 18.5813 4.8980364 curveto +18.5813 4.5978164 18.46619 4.3556764 18.34853 4.1108064 curveto +18.23874 3.8823064 17.98126 3.7891664 17.8248 3.6263564 curveto +17.63859 3.4325764 17.71517 3.4010264 17.41745 3.3235764 curveto +closepath +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +18.94656 5.9379964 moveto +19.1584 6.0815564 19.65288 6.5037464 19.84927 6.7041364 curveto +20.15032 7.0113264 20.45615 7.0883864 20.74625 7.3094564 curveto +21.09562 7.5756964 21.36463 7.7363464 21.716081 7.9116264 curveto +22.240021 8.1729464 21.745631 8.1519364 21.36046 8.1686364 curveto +21.05018 8.1820964 20.67396 8.1984064 20.34068 8.2128564 curveto +19.96451 8.2291664 19.64035 8.2432264 19.24807 8.2602364 curveto +19.0781 8.2676064 18.90814 8.2749764 18.73818 8.2823464 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +11.058081 6.3609964 moveto +10.898991 6.3609964 10.297991 6.3609964 9.9236506 6.3609964 curveto +9.6528706 6.3609964 9.2296906 6.4606964 9.0019306 6.5275864 curveto +8.6792106 6.6223764 8.3901106 6.6031664 8.0802106 6.6941864 curveto +7.7549906 6.7896964 7.3425006 6.8692064 7.0875806 6.9440764 curveto +6.7203606 7.0519264 6.3784006 7.1731864 6.0240506 7.2772664 curveto +5.6876206 7.3760764 5.4495006 7.5314764 5.1732306 7.6937564 curveto +4.8089906 7.9077164 4.5570206 8.1390264 4.1806106 8.3601364 curveto +3.8315206 8.5651864 3.5054206 9.0700664 3.2588806 9.3597064 curveto +2.9162706 9.7622164 2.6772606 10.143226 2.4789706 10.609166 curveto +2.2757806 11.086586 2.1067606 11.567026 1.9117506 12.025216 curveto +1.7229306 12.468886 1.5183906 12.957456 1.4154406 13.441276 curveto +1.3145406 13.915446 1.0273606 14.353136 0.84822058 14.774036 curveto +0.65579058 15.226186 0.63552058 15.643266 0.63552058 15.773606 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +14.33933 10.302876 moveto +14.20693 10.595156 14.14423 11.072806 13.90194 11.429396 curveto +13.70442 11.720106 13.37015 12.016406 13.17297 12.234056 curveto +12.88897 12.547546 12.59356 12.873636 12.298201 13.199656 curveto +12.020021 13.506716 11.823431 13.804186 11.496341 14.165246 curveto +11.169801 14.525686 10.912571 14.749106 10.548671 15.050376 curveto +10.232431 15.312176 9.7936806 15.426826 9.4552106 15.613636 curveto +9.1243106 15.796266 8.5739906 15.756236 8.2159606 15.855036 curveto +7.8258106 15.962696 7.3481706 15.832996 6.9767106 15.935496 curveto +6.5954506 16.040716 6.0587306 15.935496 5.6645506 15.935496 curveto +5.2171706 15.935496 4.8659706 16.015966 4.4253006 16.015966 curveto +4.0136906 16.015966 3.5635006 15.935496 3.1131506 15.935496 curveto +2.7207406 15.935496 2.2370206 15.733586 2.0196906 15.613636 curveto +1.7663706 15.473826 1.1338906 15.325916 1.0720306 15.291776 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.63630593 setlinewidth +1 setlinejoin +1 setlinecap +newpath +9.9264619 15.524615 moveto +9.601864 15.336485 9.9988871 16.363201 9.9988871 16.783897 curveto +9.9988871 17.343824 9.8991612 17.884929 9.9988871 18.462927 curveto +10.104136 19.072974 9.9702746 19.353219 10.288574 19.722199 curveto +10.538501 20.011916 10.948726 20.272725 11.157634 20.393812 curveto +11.29979 20.476203 11.505777 20.474522 11.519735 20.477757 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +10.213238 19.68757 moveto +10.382008 19.78072 9.6081369 20.54456 9.4113669 20.65317 curveto +9.2846369 20.72311 9.1736069 20.82462 9.0468769 20.89457 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +6.5393206 16.015966 moveto +6.2133206 16.195896 6.5393206 16.820626 6.5393206 17.222956 curveto +6.5393206 17.627916 6.5393206 17.996046 6.5393206 18.429956 curveto +6.5393206 18.885926 6.5393206 19.341896 6.5393206 19.797876 curveto +6.5393206 19.821846 7.2722806 20.242636 7.3411906 20.280676 curveto +7.3483106 20.418036 7.4383906 20.334316 7.4869906 20.361136 curveto +stroke +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +6.5393206 19.797876 moveto +6.8774206 19.984476 6.0047406 20.387956 5.7374506 20.683006 curveto +5.6645606 20.763466 5.5916606 20.843936 5.5187606 20.924396 curveto +stroke +gsave +0 0 0 setrgbcolor +newpath +16.59914 4.9921064 moveto +16.75393 5.5208564 16.53852 5.6023764 16.16176 5.3944364 curveto +15.78595 5.1870264 16.27681 4.8497864 16.59914 4.9921064 curveto +closepath +fill +grestore +0 0 0 setrgbcolor +[] 0 setdash +0.625 setlinewidth +1 setlinejoin +1 setlinecap +newpath +16.59914 4.9921064 moveto +16.75393 5.5208564 16.53852 5.6023764 16.16176 5.3944364 curveto +15.78595 5.1870264 16.27681 4.8497864 16.59914 4.9921064 curveto +closepath +stroke +grestore +} def + +/cameraview + { + /crtilt exch def %%or swing + /crrise exch def %%or shift + + /cftilt exch def %%or swing + /cfrise exch def %%or shift + + 30 10 translate + -4 0 moveto 28 0 rlineto stroke + + /ftopx -2.5 cftilt mul def + /ftopy 5 cfrise mul 5 add def + /fbotx 2.5 cftilt mul def + /fboty 5 cfrise mul -5 add def + + /rtopx 20 -2.5 crtilt mul add def + /rtopy 5 crrise mul 5 add def + /rbotx 20 2.5 crtilt mul add def + /rboty 5 crrise mul -5 add def + + ftopx ftopy moveto + fbotx fboty lineto + rbotx rboty lineto + rtopx rtopy lineto + ftopx ftopy lineto + stroke + + } def + +/greybox + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + .8 .8 .8 setrgbcolor + left bottom width height rectfill + 0 0 0 setrgbcolor + left bottom width height rectstroke + bottom + } def + +/blackbox + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + 0 0 0 setrgbcolor + left bottom width height rectfill + left bottom width height rectstroke + bottom + } def + +/box + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + 0 0 0 setrgbcolor + left bottom width height rectstroke + bottom + } def + +/writingline + { + /height exch def + /width exch def + /top exch def + /left exch def + + /bottom top height sub def + + .125 setlinewidth + left bottom moveto width 0 rlineto stroke + 1 setlinewidth + bottom + } def + + +/centertext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x2 x1 sub 2 div x1 add %% midpoint + s stringwidth pop 2 div %% half the string width + sub %% move left to start + + y baselineskip sub moveto s show + y baselineskip sub + } def + +/righttext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x2 + s stringwidth pop + sub 1 sub + + y baselineskip sub moveto s show + y baselineskip sub + } def + +/lefttext + { + /s exch def + /x2 exch def + /x1 exch def + /y exch def + + x1 1 add + + y baselineskip sub moveto s show + y baselineskip sub + } def + + +/picid + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (ID) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add idtext centertext pop + smallfont + + xpos wd add + } def + +/aperture + { + /cury exch def + /curx exch def + /wd 68 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Aperture (f/x)) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add aperturetext centertext pop + smallfont + + xpos wd add + } def + +/shutter + { + /cury exch def + /curx exch def + /wd 68 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Shutter (sec)) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add shuttertext centertext pop + smallfont + + xpos wd add + } def + +/geometry + { + /rrise exch def + /rtilt exch def + /rswing exch def + /rshift exch def + + /frise exch def + /ftilt exch def + /fswing exch def + /fshift exch def + + /cury exch def + /curx exch def + /wd 74 def + /headht 1 cellheight mul def + /cellht 2.5 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Geometry) centertext + pop + + /cury exch def %% add height change from box + + cell + + gsave + curx 3 add cury 6 add translate toppic + grestore + gsave + curx 3 add cury 6 add translate + fshift fswing rshift rswing cameraview + grestore + + cell + + gsave + curx 3 add cury 6 add translate sidepic + grestore + gsave + curx 3 add cury 6 add translate + frise ftilt rrise rtilt cameraview + grestore + + xpos wd add + } def + +/film + { + /cury exch def + /curx exch def + /wd 52 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Film) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add filmtext centertext pop + smallfont + + xpos wd add + } def + +/carrier + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Carrier) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add carriertext centertext pop + smallfont + + xpos wd add + } def + +/lens + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Lens) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add lenstext centertext pop + smallfont + + xpos wd add + } def + +/process + { + /cury exch def + /curx exch def + /wd 42 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Process) centertext + pop + + /cury exch def %% add height change from box + + cell + + bigfont + cury 20 add curx curx wd add processtext centertext pop + smallfont + + xpos wd add + } def + +/date + { + /cury exch def + /curx exch def + + /wd 252 108 sub def + /cellht 1.5 cellheight mul def + + curx cury wd 2 cellht mul box pop + + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + + /cury cury 2 cellht mul add def + /curx curx wd add def + + /wd 108 def + /headht 1 cellheight mul def + /cellht 2 cellheight mul def + + curx cury wd headht greybox + + cury 2 add + curx curx wd add (Date) centertext + pop + + /cury exch def %% add height change from box + + cell + + %% draw the writing lines + + xpos + } def + +/notes + { + /cury exch def + /curx exch def + + /wd 252 def + %%/headht 1 cellheight mul def + /cellht 1.5 cellheight mul def + /boxht 4.5 in 6 cellheight mul sub def %% 5in - header so far + + %%curx cury wd headht greybox + + %%cury 2 add + %%curx curx wd add (Process) centertext + %%pop + + %%/cury exch def %% add height change from box + + curx cury wd boxht box pop + + %%/cury curx 10 add cury wd 20 sub cellht writingline def + + curx cury %% save for returning to print text + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + /cury curx cury wd cellht writingline def + + moveto %% saved starting point + normalfont + notelines + { + 0 0 cellht sub rmoveto + currentpoint + 2 2 rmoveto + 3 -1 roll show + moveto + } forall + smallfont + + xpos + } def + +/record + { + /notelines exch def + + /rrise exch def + /rtilt exch def + /rswing exch def + /rshift exch def + + /frise exch def + /ftilt exch def + /fswing exch def + /fshift exch def + + /shuttertext exch def + /aperturetext exch def + /lenstext exch def + + /processtext exch def + /carriertext exch def + /filmtext exch def + /idtext exch def + + /rtop exch def + /rleft exch def + + /xpos rleft def + /ypos rtop def + smallfont + /xpos xpos ypos picid def + /xpos xpos ypos film def + /xpos xpos ypos carrier def + /xpos xpos ypos process def + /xpos xpos ypos + frise ftilt fswing fshift + rrise rtilt rswing rshift + geometry def + + /ypos ypos 3 cellheight mul sub def + /xpos rleft def + + /xpos xpos ypos lens def + /xpos xpos ypos aperture def + /xpos xpos ypos shutter def + + /ypos ypos 3 cellheight mul sub def + /xpos rleft def + + %%/xpos xpos ypos date def + %%/ypos ypos 3 cellheight mul sub def + %%/xpos rleft def + + /xpos xpos ypos notes def + } +def + +%(code)s + +/crop +{ + gsave + .2 setlinewidth + .7 .7 .7 setrgbcolor + + /bottom plantop 8.5 72 mul sub 36 add def + + planleft 4.5 sub plantop 36 add moveto + gsave + 0 -8 rmoveto 0 16 rlineto stroke + grestore + -8 0 rmoveto 16 0 rlineto stroke + + planright 4.5 add plantop 36 add moveto + gsave + 0 -8 rmoveto 0 16 rlineto stroke + grestore + -8 0 rmoveto 16 0 rlineto stroke + + + planleft 4.5 sub bottom moveto + 0 -8 rmoveto 0 16 rlineto stroke + + planright 4.5 add bottom moveto + 0 -8 rmoveto 0 16 rlineto stroke + + grestore +} def + +%%crop + +%%%%EOF +""" diff --git a/printrecord.py b/printrecord.py new file mode 100644 index 0000000..65dc48a --- /dev/null +++ b/printrecord.py @@ -0,0 +1,187 @@ +#!/usr/bin/python + +# ExiFilm -- Add film exposure metadata to EXIF tags of digital images +# Copyright (C) 2009 James E. Blair +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import os, sys +import pyexiv2 +import datetime +import decimal, fractions +import re + +from exifilm import * +import lfrecord + +class MyImage(object): + def __init__(self, fn): + if fn: + image = pyexiv2.Image(fn) + image.readMetadata() + keys = image.exifKeys() + self.image = image + else: + keys = [] + + def get(key, default=''): + if key in keys: + return image[key] + return default + + self.date = get('Exif.Photo.DateTimeOriginal', '') + + self.shutter=from_rational(get('Exif.Photo.ExposureTime')) + self.aperture=to_fstop(from_rational(get('Exif.Photo.FNumber'))) + self.lens=from_rational(get('Exif.Photo.FocalLength')) + + self.description=get('Exif.Image.ImageDescription') + extras, comments = decode_comments(get('Exif.Photo.UserComment')) + self.comments=comments + + self.id = extras.get(ID, '') + self.film = extras.get(FILM, '') + self.carrier = extras.get(CARRIER, '') + self.process = extras.get(PROCESS, '') + + self.front_movements = extras.get(FRONT_MOVEMENTS, '').split('/') + self.rear_movements = extras.get(REAR_MOVEMENTS, '').split('/') + + def render(self): + r = ' (%s) (%s) (%s) (%s)\n' % (self.id, self.film, self.carrier, self.process) + r += ' (%s) (%s) (%s)\n' % (self.lens, self.aperture, self.shutter) + r += ' ' + + if 'rising' in self.front_movements: r += '1 ' + elif 'falling' in self.front_movements: r += '-1 ' + else: r += '0 ' + + if 'forward tilt' in self.front_movements: r += '1 ' + elif 'backward tilt' in self.front_movements: r += '-1 ' + else: r += '0 ' + + if 'left swing' in self.front_movements: r += '1 ' + elif 'right swing' in self.front_movements: r += '-1 ' + else: r += '0 ' + + if 'left shift' in self.front_movements: r += '1 ' + elif 'right shift' in self.front_movements: r += '-1 ' + else: r += '0 ' + + r += ' ' + + if 'rising' in self.rear_movements: r += '1 ' + elif 'falling' in self.rear_movements: r += '-1 ' + else: r += '0 ' + + if 'forward tilt' in self.rear_movements: r += '1 ' + elif 'backward tilt' in self.rear_movements: r += '-1 ' + else: r += '0 ' + + if 'left swing' in self.rear_movements: r += '1 ' + elif 'right swing' in self.rear_movements: r += '-1 ' + else: r += '0 ' + + if 'left shift' in self.rear_movements: r += '1' + elif 'right shift' in self.rear_movements: r += '-1' + else: r += '0' + + r += '\n' + + notes = [] + if self.description: + notes.append(self.description) + if self.date: + notes.append(str(self.date.date())) + if self.description or self.date: + notes.append('') + notes += self.comments.split('\n') + + r += ' [ ' + for note in notes: + r += '('+note+') ' + r += ']\n' + r += 'record\n' + return r + +def main(): + directory = sys.argv[1] + start = int(sys.argv[2]) + end = int(sys.argv[3]) + end += end%4 + + files = os.listdir(directory) + files.sort() + images = {} + for fn in files: + if not (fn.lower().endswith('.jpeg') or + fn.lower().endswith('.jpg')): + continue + i = MyImage(os.path.join(directory,fn)) + if i.id: + images[int(i.id)] = i + + code = '' + page = 0 + i = start + while i