JPG Photo Settings
RéponduCan I set the JPG Photo Settings programmatically?

-
Commentaire officiel
Hi Nico, I'm Jack from the Mobile team.
After doing some digging, and checking with our developers, I was able to find out how you can do this. There are an operation and a command that aren't documented yet that you'd need to use:
- `settings.get`: A command used to obtain an object called SettingsInfo that contains every item in the settings dialog
- `settings.update`: Using a SettingsInfo object, you can update the settings.
To update the JPG photo settings, you need to set the `PhotoResize` variable in that SettingsInfo object. The value correspondance is as follows:
- Original: 0
- Large: 1
- Medium: 2
- Small: 3
For further information, I'll attach the JSON of the Workflow I created to achieve this. Please don't hesitate to reach out with any questions or clarifications.
{ "_properties": { "isServerWorkflow": false }, "components": [ { "id": 2, "steps": [ { "id": 3, "inputs": {}, "position": "0,0", "purpose": "start", "title": "Start", "transitions": [ { "id": 7, "inputs": {}, "position": "90,60 90,110", "target": { "id": 6 } } ] }, { "action": "gcx:wf:app::RunOperation", "id": 6, "inputs": { "operationName": "settings.get" }, "name": "getSettings", "position": "-30,110", "title": "Run Operation", "transitions": [ { "id": 25, "inputs": {}, "position": "90,170 90,220", "target": { "id": 24 } } ] }, { "action": "gcx:wf:core::Log", "id": 8, "inputs": { "message": { "accessors": [ "$getSettings" ], "annotations": [ { "count": 12, "index": 0, "kind": "idref" } ], "code": "$getSettings.result", "source": "$getSettings.result" } }, "position": "-30,570", "title": "Log", "transitions": [ { "id": 14, "inputs": {}, "position": "90,600 90,660", "target": { "id": 13 } } ] }, { "action": "gcx:wf:app::RunOperation", "id": 13, "inputs": { "operationName": "settings.update", "operationParameter": { "accessors": [ "$getSettings" ], "annotations": [ { "count": 12, "index": 0, "kind": "idref" } ], "code": "$getSettings.result", "source": "$getSettings.result" } }, "name": "updateSettings", "position": "-30,660", "title": "Run Operation" }, { "action": "gcx:wf:core::Log", "id": 19, "inputs": { "message": { "accessors": [ "$evaluate2" ], "annotations": [ { "count": 10, "index": 0, "kind": "idref" } ], "code": "$evaluate2.result", "source": "$evaluate2.result" } }, "position": "-30,400", "title": "Log", "transitions": [ { "id": 35, "position": "90,430 90,480", "target": { "id": 34 } } ] }, { "action": "gcx:wf:core::Evaluate", "id": 24, "inputs": { "expression": { "accessors": [ "result" ], "annotations": [ { "count": 6, "index": 7, "kind": "idref" } ], "code": "typeof (result)", "source": "typeof(result)" } }, "name": "evaluate2", "position": "-30,220", "title": "Evaluate Expression", "transitions": [ { "id": 30, "inputs": {}, "position": "90,280 90,330", "target": { "id": 29 } } ] }, { "action": "gcx:wf:core::Log", "id": 29, "inputs": { "message": { "accessors": [ "$getSettings" ], "annotations": [ { "count": 12, "index": 0, "kind": "idref" } ], "code": "$getSettings.result", "source": "$getSettings.result" } }, "position": "-30,330", "title": "Log", "transitions": [ { "id": 31, "inputs": {}, "position": "90,360 90,400", "target": { "id": 19 } } ] }, { "action": "gcx:wf:core::Evaluate", "id": 34, "inputs": { "expression": { "accessors": [ "$getSettings" ], "annotations": [ { "count": 12, "index": 0, "kind": "idref" } ], "code": "$getSettings.result.PhotoResize = 2", "source": "$getSettings.result.PhotoResize=2" } }, "name": "evaluate3", "position": "-30,480", "title": "Evaluate Expression", "transitions": [ { "id": 36, "position": "90,540 90,570", "sourceConnector": "bottom", "target": { "id": 8 }, "targetConnector": "top" } ] } ] } ], "deploymentConfig": { "supportedApps": { "VSM": true } }, "designerVersion": "5.42.0+49", "licenseInfo": { "licenseeId": "88cb61d6-af47-9b3e-5181-ed674c4c0815" }, "start": { "id": 3 } } -
Is this setting honored by VertiGIS Studio Go on iOS and Android? My version of VertiGIS Studio Go 5.40.0.347 on iOS doesn't have a front end settings option for setting this, and hoping not to have to do trial & error if this is known by VertiGIS Mobile developers. (Nevermind, it does - just requires scrolling so it was non-intuitive as a new user)
1 -
And would it be appropriate to make this workflow (or one similar to it) part of the Application Initializing event, or something else?
0 -
Hi Alison,
Yes, it would make sense to put this in Application Initializing (or Application Initialized to let everything else stabilize first) to make the setting apply for all app sessions.0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
4 commentaires