📏 ImageSize (Side) - Yaser:
ImageSizeBySide measures an image and reports the dimension of either its longer or shorter side. This gives you a quick way to base another step in your workflow on the image’s actual size, regardless of whether it is portrait, landscape, or square. The node reads the image’s height and width and compares them; it does not resize or otherwise change the image.
📏 ImageSize (Side) - Yaser Input Parameters:
image
The image to measure. This required input accepts an IMAGE connection. The node reads its height and width from the image data and uses those dimensions for the comparison. No minimum, maximum, or default image size is specified in the source; the connected image must have the expected four-dimensional image shape.
side
Chooses which dimension to report. This required selection has exactly two options: Longest returns the larger of the image’s width and height, while Shortest returns the smaller. For a square image, both choices return the same value. The source specifies no default selection or numeric minimum and maximum.
📏 ImageSize (Side) - Yaser Output Parameters:
resolution
An INT containing the selected side length: the larger dimension when side is Longest, or the smaller dimension when it is Shortest. For example, an image that is 1024 pixels wide and 768 pixels high produces 1024 for Longest and 768 for Shortest. The node also displays the number as text in its UI; that display is not an additional output socket.
📏 ImageSize (Side) - Yaser Usage Tips:
- Choose
Longestwhen a later step needs a number based on the image’s largest dimension, regardless of orientation. - Choose
Shortestwhen a later step needs a number based on the dimension that limits the image’s size. - Connect the image you intend to measure. If an earlier node resizes it, connect that node’s resulting image to measure the resized dimensions.
- You do not need to switch settings when changing between portrait and landscape images: the node compares width and height for you.
📏 ImageSize (Side) - Yaser Common Errors and Solutions:
Required input is missing
- Explanation: The workflow may report a missing required input if
imageis not connected orsidehas no valid selection. The exact validation message depends on the host application. - Solution: Connect an
IMAGEoutput toimageand select eitherLongestorShortest.
ValueError: not enough values to unpack or ValueError: too many values to unpack
- Explanation: The node expects the image data to have four dimensions. This error can occur if something with a different shape reaches the node.
- Solution: Check that the connection supplies a standard
IMAGEvalue, rather than a mask, single-channel array, or other data with an incompatible shape.
AttributeError mentioning shape
- Explanation: The supplied value does not provide the image-shape information the node reads. This can happen when incompatible data reaches the input.
- Solution: Reconnect
imageto a node that produces anIMAGEoutput and check any conversion steps upstream.
UnboundLocalError mentioning result
- Explanation: The source assigns a result only when
sideis exactlyLongestorShortest. A different value passed to the node could leave the result unset; the normal selection menu limits you to the two supported choices. - Solution: Select one of the two provided options. If the value comes from a modified workflow or custom integration, make sure its spelling and capitalization match exactly.
