MBS FileMaker Plugin Example Databases

Correct Image Orientation

All examples are included with download of MBS FileMaker Plugin.

Correct Image Orientation.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists0
Custom Functions0
Custom Menus0
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Correct Image Orientation
6 fields defined, 1 record
Correct Image Orientation

Fields

Table Name: Correct Image Orientation - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      OutputNormal, BinaryAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
          Input NameNormal, TextAuto-Enter: Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
                Output NameNormal, TextAuto-Enter: Validation:
                • Only during data entry
                Storage:
                • Repetitions: 1
                • Indexing: None
                • Automatically create indexes as needed
                • Index Language: German
                      Input OrientationNormal, TextAuto-Enter: Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                            Output OrientationNormal, TextAuto-Enter: Validation:
                            • Only during data entry
                            Storage:
                            • Repetitions: 1
                            • Indexing: None
                            • Automatically create indexes as needed
                            • Index Language: German

                                  Layout Objects: Correct Image Orientation

                                  Regular Fields

                                  Field Name: Correct Image Orientation::Input
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 52 pt
                                  • Left: 138 pt
                                  • Bottom: 281 pt
                                  • Right: 637 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  No

                                  Field Name: Correct Image Orientation::Output
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 290 pt
                                  • Left: 138 pt
                                  • Bottom: 519 pt
                                  • Right: 637 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  No

                                  Field Name: Correct Image Orientation::Input Name
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 104 pt
                                  • Left: 12 pt
                                  • Bottom: 125 pt
                                  • Right: 123 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  Yes

                                  Field Name: Correct Image Orientation::Output Name
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 351 pt
                                  • Left: 16 pt
                                  • Bottom: 372 pt
                                  • Right: 127 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  Yes

                                  Field Name: Correct Image Orientation::Input Orientation
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 150 pt
                                  • Left: 12 pt
                                  • Bottom: 171 pt
                                  • Right: 123 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  Yes

                                  Field Name: Correct Image Orientation::Output Orientation
                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                  • Top: 397 pt
                                  • Left: 16 pt
                                  • Bottom: 418 pt
                                  • Right: 127 pt
                                  • Anchoring: Left, Top
                                  Field Format:
                                  • Edit Box
                                  Field Behavior:
                                  • Allow field to be entered: In Find mode, In Browse mode
                                  • Touch keyboard type: Default for Data Type
                                  • Go to next field using: Tab key
                                  Yes

                                  Buttons

                                  Button PropertiesCoordinatesScript/Script Step
                                    Type:
                                  • Text: Fix Orientation
                                  • Top: 189 pt
                                  • Left: 652 pt
                                  • Bottom: 220 pt
                                  • Right: 787 pt
                                  • Anchoring: Left, Top
                                  Perform Script [ “Fix Orientation” ]

                                  Scripts:


                                  Script Hierarchy

                                  Fix Orientation

                                  Script NameFix Orientation
                                  Run script with full access privilegesOff
                                  Include In MenuYes
                                  Layouts that use this script
                                  Scripts that use this script
                                    Script Definition
                                    Script Steps
                                    • #load image
                                    • Set Variable [ $Image; Value:MBS( "GMImage.NewFromContainer"; Correct Image Orientation::Input ) ]
                                    • If [ MBS("IsError") = 0 ]
                                    • Set Variable [ $orientation; Value:MBS( "GMImage.GetOrientation"; $Image ) ]
                                    • If [ $orientation > 0 ]
                                    • If [ $orientation = 1 ]
                                    • #TopLeftOrientation = 1, (Line direction: Left to right, Frame Direction: Top to bottom)
                                    • #nothing to do
                                    • Else If [ $orientation = 2 ]
                                    • #TopRightOrientation = 2, (Line direction: Right to left, Frame Direction: Top to bottom)
                                    • #Flip horizontally
                                    • Set Variable [ $r; Value:MBS( "GMImage.Flop"; $Image ) ]
                                    • Else If [ $orientation = 3 ]
                                    • #BottomRightOrientation = 3, (Line direction: Right to left, Frame Direction: Bottom to top)
                                    • #Rotate 180°
                                    • Set Variable [ $r; Value:MBS( "GMImage.Rotate"; $Image; 180 ) ]
                                    • Else If [ $orientation = 4 ]
                                    • #BottomLeftOrientation = 4, (Line direction: Left to right, Frame Direction: Bottom to top)
                                    • #Flip vertically
                                    • Set Variable [ $r; Value:MBS( "GMImage.Flip"; $Image ) ]
                                    • Else If [ $orientation = 5 ]
                                    • #LeftTopOrientation = 5, (Line direction: Top to bottom, Frame Direction: Left to right)
                                    • #Rotate 90° and flip horizontally
                                    • Set Variable [ $r; Value:MBS( "GMImage.Rotate"; $Image; 90 ) ]
                                    • Set Variable [ $r; Value:MBS( "GMImage.Flop"; $Image ) ]
                                    • Else If [ $orientation = 6 ]
                                    • #RightTopOrientation = 6, (Line direction: Top to bottom, Frame Direction: Right to left)
                                    • #Rotate 90°
                                    • Set Variable [ $r; Value:MBS( "GMImage.Rotate"; $Image; 90 ) ]
                                    • Else If [ $orientation = 7 ]
                                    • #RightBottomOrientation = 7, (Line direction: Bottom to top, Frame Direction: Right to left)
                                    • #Rotate -90° and flip horizontally
                                    • Set Variable [ $r; Value:MBS( "GMImage.Rotate"; $Image; -90 ) ]
                                    • Set Variable [ $r; Value:MBS( "GMImage.Flop"; $Image ) ]
                                    • Else If [ $orientation = 8 ]
                                    • #LeftBottomOrientation = 8 (Line direction: Bottom to top, Frame Direction: Left to right)
                                    • #Rotate -90°
                                    • Set Variable [ $r; Value:MBS( "GMImage.Rotate"; $Image; -90 ) ]
                                    • End If
                                    • Set Variable [ $r; Value:MBS( "GMImage.SetOrientation"; $Image; 1 ) ]
                                    • Set Variable [ $r; Value:MBS( "GMImage.SetEXIFOrientation"; $Image; 1 ) ]
                                    • End If
                                    • # Write back to new field
                                    • Set Field [ Correct Image Orientation::Output; MBS( "GMImage.WriteToJPEGContainer"; $Image; GetAsText(Correct Image Orientation::Input)) ]
                                    • #free memory
                                    • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $Image) ]
                                    • End If
                                    Fields used in this script
                                    Scripts used in this script
                                      Layouts used in this script
                                        Tables used in this script
                                        Table occurrences used by this script
                                        Custom Functions used by this script
                                          Custom menu set used by this script

                                            Download example: Correct Image Orientation

                                            Used functions:




                                            Links
                                            MBS Xojo Plugins