Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

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: 90 pt
                                  • Left: 59 pt
                                  • Bottom: 319 pt
                                  • Right: 558 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: 328 pt
                                  • Left: 59 pt
                                  • Bottom: 557 pt
                                  • Right: 558 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: 179 pt
                                  • Left: 581 pt
                                  • Bottom: 200 pt
                                  • Right: 692 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: 417 pt
                                  • Left: 581 pt
                                  • Bottom: 438 pt
                                  • Right: 692 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: 225 pt
                                  • Left: 581 pt
                                  • Bottom: 246 pt
                                  • Right: 692 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: 463 pt
                                  • Left: 581 pt
                                  • Bottom: 484 pt
                                  • Right: 692 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: 308 pt
                                  • Left: 581 pt
                                  • Bottom: 339 pt
                                  • Right: 716 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
                                    • #We determin the orientation of the input picture and rotate and flip it in the right orientation
                                    • #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.Free"; $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: