Integrating with PhotoAlign Studio

Integrate your service with PhotoAlign Studio.

Integrating with Asset Importer App



Asset Importer App
Asset Importer App (AssetImporter.exe) is a program provided by PhotoAlign, used as a bridge application to import photo files and information from other partnered programs or programs arbitrarily supported by us.
For example, when the Asset Importer App is executed with appropriate command arguments, the app reads the information, displays the photo files, and transfers the information to PhotoAlign, PhotoPort, or PhotoSlide.

For more information about it, visit the Asset Importer App page.


Preloading photo files into the Asset Tab when launching PhotoAlign

1. Load Files from a Specific Folder
This method preloads photos from a specific folder into the Asset Tab of PhotoAlign.
When launching the PhotoAlign program, pass the folder path as the first command argument.

Example of execution command argument:
"C:\Program Files\PhotoAlign Studio\PhotoAlign.exe" "C:\Users\ComputerUser\Pictures\Demo"

2. Load Using Template Path or Template Name
This method loads photos with a specific template pre-applied.
The absolute path or exact name of the template must be provided.
This additional information should be written in a JSON file and passed as a command argument when executing PhotoAlign.

Example of execution command argument:
"C:\Program Files\PhotoAlign Studio\PhotoAlign.exe" "C:\Temp\photoalign_import.json"

However, if the JSON file is located at "C:\Users\ComputerUser\Documents\PhotoAlign\api_input.json", PhotoAlign will automatically read and process this file for convenience even without an additional command argument as described above. Once processed, the api_input.json file will be deleted.

templatepath can be used to specify the absolute path of the template to load, and templatename specifies the name of the template.
If both arguments are provided, the path is prioritized; if the path does not point to a template, the template name is used.
templatename must match the template name loaded initially by PhotoAlign and will follow the selected language in PhotoAlign.

mode is an argument that determines whether the main editor screen of PhotoAlign runs and automatically arranges the photos.
  • If the "mode" value is allocation, the photos are arranged according to the required "allocation" field in the JSON file. The key values of "allocation" must match the canvas names of the selected template.
  • If the "mode" value is aiallocation, the photos are automatically arranged by AI. In this mode, either "selectedfolder" or "assetfolder" must be specified.
  • If the "mode" value is load, the photos are just loaded without automatic arrangement.
Specifying a path in selectedfolder sets it as the folder in the File Browser Tab.
Specifying a path in assetfolder loads the photos in the Asset Tab.

Example of a JSON file containing manual arrangement information:

{
	"version": 1,
	"mode": "allocation", // allocation, aiallocation, load
	"templatepath": "C:\\Users\\ComputerUser\\Documents\\PhotoAlign\\CanvasTemplate\\Orthodontic Basic Photo", // Full template path
    "templatename": "Orthodontic Intraoral and Facial Basic Set (3:2 Ratio)", // or language specific template name
	"allocation": {
		"IO Frontal": "C:\\Users\\ComputerUser\\Pictures\\Demo\\DSC_0022.JPG", // Allocation canvas name and file path
        "Facial Right": "C:\\Users\\ComputerUser\\Pictures\\Demo\\DSC_0032.JPG"
	},
	"selectedfolder": "C:\\Users\\ComputerUser\\Pictures\\Demo2", // Folder browser default path
    "assetfolder": "C:\\Users\\ComputerUser\\Pictures\\Demo3", // Load assets automatically
	"from": "PhotoAlign Manager" // (Optional) Source application name
}

                

Example of a JSON file for AI arrangement:

{
	"version": 1,
	"mode": "aiallocation",
	"templatepath": "C:\\Users\\ComputerUser\\Documents\\PhotoAlign\\CanvasTemplate\\Orthodontic Basic Photo",
    "templatename": "Orthodontic Intraoral and Facial Basic Set (3:2 Ratio)",
	"selectedfolder": "C:\\Users\\ComputerUser\\Pictures\\Demo2", // Either selectedfolder or assetfolder must be specified for AI allocation.
    "assetfolder": "C:\\Users\\ComputerUser\\Pictures\\Demo3",
    "from": "PhotoAlign Manager"
}
                


Retrieve Information of Photos Edited by PhotoAlign

Output of Information for Photos Edited in PhotoAlign
After batch saving photos in PhotoAlign, the metadata of the results is always saved in a JSON file.
External programs can read this JSON file as needed to use the information.
The JSON file remains until the next batch save, and the previous file will be overwritten.

The JSON file is typically saved at "%APPDATA%\local\Temp\photoalign_output.json".
If the file is not found at this location, it might be due to invalid user permissions or changes to the %APPDATA% path.
Each key name in the JSON self-explains.

Example of the output JSON file:


{
	"version": 1,
	"templatepath": "C:\\Users\\ComputerUser\\Documents\\PhotoAlign\\CanvasTemplate\\Orthodontic Basic Photo",
	"templatename": "Orthodontic Intraoral and Facial Basic Set (3:2 Ratio)",
	"input": {
		// any previous JSON input data if available
	},
	"result": [
		{
			"canvastitle": "IO Frontal",
			"appointment": "io_frontal", // will be replaced with "class" later
			"input": "C:\\Users\\ComputerUser\\Pictures\\Demo\\DSC_0022.JPG", // Original path
			"output": "C:\\Users\\ComputerUser\\Pictures\\Result\\io_frontal.JPG", // Saved path
			"outputfolder": "C:\\Users\\ComputerUser\\Pictures\\Result",
			"outputname": "io_frontal", // Filename without extension
			"extension": ".JPG", // File extension
			"zoom": 1.5,
			"rotation": 3.2,
			"left": 0.01,
			"top": 0.11,
			"horizontalflip": true,
			"verticalflip": false
		}
	]
}
                


Importing Photo Files into PhotoPort



Import Photo Files into PhotoPort to Create a New Folder or Insert Them into Existing Folders
To copy photo files into PhotoPort, you need to provide the absolute path of a JSON file that contains the file paths and additional information as a command argument during execution.

Example of execution command argument:
"C:\Program Files\PhotoAlign Studio\PhotoPort.exe" "C:\Temp\import_new_photos.json"

mode is a parameter that sets the operation mode of PhotoPort. Currently, only "import" is supported.
foldername, if provided, will be automatically pre-filled as the "Folder Name" when the user selects [Create New Patient Folder].
folderdescription, if provided, will be automatically pre-filled as the "Folder Description" when the user selects [Create New Patient Folder].
foldermemo, if provided, will be automatically pre-filled as the "Folder Memo" when the user selects [Create New Patient Folder].
subfoldername, if provided, will be automatically pre-filled as the Subfolder Name of the selected folder.
assetlist array contains information about each file.
filename in "assetlist" is the name of the file to be saved, filepath is the absolute path of the original file, and subfolder is the subfolder name where the file will be saved.
If "subfolder" is not provided, the file will be saved in the folder selected by the user.
A single JSON file can include files assigned to multiple "subfolders" simultaneously. This means multiple subfolders can be created under one patient folder, and photos can be copied into each folder.

Example of a JSON file containing file information and additional details:

{
  "version": 1,
  "mode": "import",
  "from": "PhotoAlign Asset Importer",
  "foldername": "David 12345", // Optional
  "folderdescription": "David Jones, 12345, Class II, VIP", // Optional
  "foldermemo": "David Jones, 12345, Private Insurance", // Optional
  "subfoldername": "2024-11-11", // Optional
  "assetlist": [
    {
      "filename": "01.jpg",
      "filepath": "C:\\Users\\ComputerUser\\Digital Camera\\IMG_01.JPG",
      "subfolder": "2024-11-10" // can be blank, but should not be omitted
    },
    {
      "filename": "02.jpg",
      "filepath": "C:\\Users\\ComputerUser\\Digital Camera\\IMG_02.JPG",
      "subfolder": "2024-11-11"
    }
  ]
}
                


Preselect a Folder When Launching PhotoSlide



"C:\Program Files\PhotoAlign Studio\PhotoSlide.exe" "C:\Users\ComputerUser\Pictures\Photo Series"




All of the above content is subject to change without notice, and unexpected errors or bugs may occur when using the integration protocol.