Page MenuHomeFeedback Tracker

Scripting Command Request: "getImageResolution"
Closed, ResolvedPublic

Description

This is a request for the addition of a scripting command to return the resolution of a .paa or .jpg image given a PBO file path. This command may work as follows:

getImageResolution

Description: Returns the resolution (width and height) of the .paa or .jpg image specified by the given file path. [0, 0] is returned if the given file path is not an image or does not exist.

Syntax: getImageResolution filepath

  • filepath <STRING>

Return Value: Resolution of the image [width, height]. <ARRAY>

Examples:

getImageResolution "\a3\ui_f\data\igui\cfg\actions\eject_ca.paa"; // -> [64, 64]

getImageResolution "\a3\editorpreviews_f\data\cfgvehicles\b_soldier_f.jpg"; // -> [455, 256]

Details

Severity
Feature
Resolution
Open
Reproducibility
N/A
Operating System
Windows 10 x64
Category
Scripting

Event Timeline

dedmen added a subscriber: dedmen.Apr 25 2020, 8:54 PM

Why do you need it?

Resizing an editor preview control for Zeus based on the image resolution. Seems the contact editor previews are not as wide as the others and 3DEN handles that correctly by decreasing the width of the container so the border around the image is the same.

BIS_fnc_KK changed the task status from New to Feedback.Jun 14 2021, 12:43 AM
R3vo closed this task as Resolved.Jun 28 2021, 4:35 PM
R3vo claimed this task.

Works nicely.