Unplanned
Last Updated: 15 Oct 2025 11:48 by ADMIN
Andrew
Created on: 22 Feb 2022 11:54
Category: Reporting
Type: Feature Request
18
Ability to rotate the image in PictureBox

Images taken with a mobile device are sometimes displayed in PictureBox  rotated by 90, 180 or 270 degrees. The reason is that whenever a photo is taken, the device saves its current accelerometer orientation into a corresponding Exif tag with the image metadata, so this info is then read and taken into account by our Report Designer.

5 comments
ADMIN
Dimitar
Posted on: 15 Oct 2025 11:48

Hello Jose,

Thank you for the feedback!

Currently, this item is not in our recent plans, however, I will add it for discussion on our next planning meeting so that a milestone can be set.

In the meantime, I would recommend implementing a custom function that programmatically rotates the image. For example:

    public static class ImageHelper
    {
        public static Image RotateImageAndResetExif(string imagePath, int rotateFlipType)
        {
            const int OrientationId = 0x0112;

            Image image = Image.FromFile(imagePath);

            // Rotate the image pixels
            image.RotateFlip(GetRotateFlipTypeFromInt(rotateFlipType));

            // Reset EXIF orientation to '1' (normal)
            if (image.PropertyIdList.Contains(OrientationId))
            {
                PropertyItem prop = image.GetPropertyItem(OrientationId);
                prop.Value = BitConverter.GetBytes((short)1);
                image.SetPropertyItem(prop);
            }

            return image;
        }

        public static RotateFlipType GetRotateFlipTypeFromInt(int value)
        {
            switch (value)
            {
                case 0:
                    return RotateFlipType.RotateNoneFlipNone;
                case 1:
                    return RotateFlipType.Rotate90FlipNone;
                case 2:
                    return RotateFlipType.Rotate180FlipNone;
                case 3:
                    return RotateFlipType.Rotate270FlipNone;
                case 4:
                    return RotateFlipType.RotateNoneFlipX;
                case 5:
                    return RotateFlipType.Rotate90FlipX;
                case 6:
                    return RotateFlipType.Rotate180FlipX;
                case 7:
                    return RotateFlipType.Rotate270FlipX;
                default:
                    throw new ArgumentOutOfRangeException(nameof(value), "Invalid rotation value");
            }
        }
    }

The RotateImageAndResetExif function can be invoked in the report after registering and loading the assembly with it in the Report Designer/Reporting REST Service. 

The expression for calling the method can look like this:

= UserFunctions.ImageHelper.RotateImageAndResetExif("C:\images\img1.jpg", 1)

The first parameter provides the absolute path to the image, while the second is the RotateFlipType that the image pixels must be rotated for. More details on the available options can be found in the EXIF Tags atricle.

For more instructions on how to use custom functions in Reporting, please visit the Custom User Functions Explained - Telerik Reporting article.

I hope that the temporary workaround will work fot your needs.

Regards,
Dimitar
Progress Telerik

Your perspective matters! Join other professionals in the State of Designer-Developer Collaboration 2025: Workflows, Trends and AI survey to share how AI and new workflows are impacting collaboration, and be among the first to see the key findings.
Start the 2025 Survey
Jose Tuttu
Posted on: 08 Oct 2025 12:35

Hi,

Image rotation is creating serious problems in our system. We have legal reports of equipment components, and the images are getting rotated randomly due to the XIFF property. In the Report document we are having description that a component is facing down while the image depicting same shows the component facing up or sideways, questioning the validity of our report. Please fix this on priority. Everywhere it is showing correct orientation except in the report generated. Is there any workaround for this? 

SwanB
Posted on: 07 Apr 2025 16:23
Thank you Dimitar, looing forward to that update  👍
ADMIN
Dimitar
Posted on: 07 Apr 2025 15:03

Hello Svein,

Thank you for the feedback!

I have provided your feedback to the development team and while the feature is not currently in our immediate plans, I have also moved it for discussion on our next planning so that we can try and determine the closest release in which we would be able to implement this feature. 

Please stay tuned for updates.

Regards,
Dimitar
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

SwanB
Posted on: 01 Apr 2025 06:26
Telerik Reporting does annoyingly still not allow us to select-/dynamically switch-/override control orientation-/size of image displayed in PictureBox at runtime, based on image height/width or alternatively based on the EXIF metadata for the image orientation, within the report designer. So if Telerik after all these years could add a basic property-/having a simple logic for Calculating orientation(landscape vs portrait) it would be extremely useful.
( EXIF metadata, tells programs how to display the image (e.g. rotated 90°, flipped, etc.) without changing the actual pixel data. Seemingly, if Telerik is looking at the EXIF orientation tag, it might not correctly reflect the correct display orientation of image compared to the reported height and width (like if the image is rotated in the EXIF metadata) )