I'm currently developing an API where it takes a in a video as parameter and then generates a thumbnail from that. When it's later presented with a thumbnail the thumbnail is rotated in the wrong way, i know this has to do with the orientation but i can't seem to find either 0x0112 (274) or 0x5029 (20521) in the PropertyIdList. The only ones i got are 771, 769, 37510, 20753, 20753, 20754. None of these as far as i know are focused on the orientation of the image. I generated the thumbnail with Nreco if that has any connection with it. This is my code thus far:
if(Array.IndexOf(image.Img.PropertyIdList,20521)>-1)
{
var orientation = (int)image.Img.GetPropertyItem(20521).Value[0];
switch(orientation)
{
case 1:
break;
case 2:
image.Img.RotateFlip(RotateFlipType.RotateNoneFlipX);
break;
case 3:
image.Img.RotateFlip(RotateFlipType.Rotate180FlipNone);
break;
case 4:
image.Img.RotateFlip(RotateFlipType.Rotate180FlipX);
break;
case 5:
image.Img.RotateFlip(RotateFlipType.Rotate90FlipX);
break;
case 6:
image.Img.RotateFlip(RotateFlipType.Rotate90FlipNone);
break;
case 7:
image.Img.RotateFlip(RotateFlipType.Rotate270FlipX);
break;
case 8:
image.Img.RotateFlip(RotateFlipType.Rotate270FlipNone);
break;
}
}
But it never enters this block of code since it can't find the the indexOf propertyIdList 20521.
Any help would be higly appritiated! Thank you.
EDIT: Video was taken with an Iphone 6