[Discussions] What is the practical sense for needRotate
boolean?
#32
-
ContentWhat is the practical sense for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The exif of jpeg maybe contains orientation attr. A example to know it: https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation See the attr info to read wiki. This value range is 1~8, but only 1, 3, 6 and 8 can be seen when using. A document of MIT: https://www.media.mit.edu/pia/Research/deepview/exif.html#orientation From load to render graph: graph TD;
A[Load Image] --> B{exif orientation = 6 or 8?};
B -- 6 --> C[Rotate counterclockwise by 90 degrees];
B -- 8 --> D[Rotate clockwise by 90 degrees];
B -- other values --> E[No rotation];
C --> F[Render rotated image];
D --> F;
E --> F;
This is image size getter about the attribute: graph TD;
A[Read metadata] --> B[Get image width and height];
B --> C[Determine if rotation is needed];
C --> D{Need rotation?};
D -- Yes --> E[Rotate image];
D -- No --> F[Do not rotate image];
E --> G[ Return Size with needRotation=true];
F --> H[Return Size with needRotation=false];
|
Beta Was this translation helpful? Give feedback.
The exif of jpeg maybe contains orientation attr.
A example to know it: https://developer.mozilla.org/en-US/docs/Web/CSS/image-orientation
See the attr info to read wiki.
This value range is 1~8, but only 1, 3, 6 and 8 can be seen when using.
A document of MIT: https://www.media.mit.edu/pia/Research/deepview/exif.html#orientation
From load to render graph:
This is image size getter about the attrib…