Images Flipped (OpenInsight 64-bit)
At 08 APR 2020 12:12:05PM Richard Richter wrote:
Just lately when I'm inserting an image in a Bitmap Control, the images are rotated 180°(upside down). The filename is coming from a CHOOSEFILE. I'm obviously doing something wrong and I think it's in the CHOOSEFILE but I don't know what. This is the code for the CHOOSEFILE and the Set_Property:
File = ""
File<1> = 0
File<2> = "All Files (*.*)/*.*/"
File<3> = 1
File<4> = "WIN_20140709_174325.jpg"
File<5> = 0x200
File<6> = "\BMPS\Trains\"
picadd = Utility("CHOOSEFILE",File)
call set_Property( @window : ".PHOTO.IMAGE", "FILENAMES", picadd )
Any ideas?
Thanks,
Richard Richter
At 08 APR 2020 08:56PM Carl Pates wrote:
Hi Ricard
Looks like it might be a problem with the image control not respecting the JPEG Orientation metadata, which is a newer extension that some older image controls don't look at (SRP came across this a few years back and I think they wrote a blog article describing it)
What version of OI is this? Feel free to send me a sample of the image to test against at the email address below.
Thanks
At 09 APR 2020 09:05AM Richard Richter wrote:
Hi Ricard
Looks like it might be a problem with the image control not respecting the JPEG Orientation metadata, which is a newer extension that some older image controls don't look at (SRP came across this a few years back and I think they wrote a blog article describing it)
What version of OI is this? Feel free to send me a sample of the image to test against at the email address below.
Thanks
Good Morning Carl,
Thanks for your help. I'm using OI 10.0.7. I emailed to you one of the photographs that is showing upside down. As I said, in Windows Photos it displays perfectly but when I set it in a BITMAP control it's flipped. And that's in more than one control over several forms. Yet there is no change to the original file.
Richard Richter
At 09 APR 2020 11:22AM Donald Bakke wrote:
In case it is helpful and relevant, here is the aforementioned blog article:
At 11 APR 2020 09:39AM Richard Richter wrote:
In case it is helpful and relevant, here is the aforementioned blog article:
Don,
Wow! That is impressive work. I have to admit that it took me three readings to understand it but when I got it I was impressed. The problem is how do I apply that knowledge to a OI10 Bitmap? I have tried setting the IMAGEALIGN property to "0" but that didn't work. I changed the Align property in the Image setup for the BITMAP from Centered to Upper Left but that didn't work. I don't want to bother you with this question, but I couldn't resist telling you how much I respected your work. Therefore this question is for anyone - How can I control the image rotation in OI 10.0.7?
Richard Richter
At 13 APR 2020 12:36AM Donald Bakke wrote:
Therefore this question is for anyone - How can I control the image rotation in OI 10.0.7?
I don't have a ready answer for you with regard to OI 10.0.7. AFAIK, it is supposed to automatically work with the OI 10.x Bitmap control. Just out of curiosity, is this a form and control that was converted from OI 9.x? If so, try creating a new form with a new Bitmap control and see if the problem is still evident. I'm wondering if the conversion process didn't update the Bitmap control completely.
You might also want to make sure this is the same problem as described in the blog article. I suggest downloading the JHEAD command line utility and run it as we documented it against a copy of your image. Then see if it displays corrects in the Bitmap control.
At 13 APR 2020 07:20PM Carl Pates wrote:
Hi Richard,
This is fixed for the next build of v10.0.8 - the image you sent me had a "rotate 180" orientation on it and it now displays as intended. SRP had contacted me a while back about JPEG rotation in v10, so I put the hooks in for it but never had an image to test with, so it never got fully completed.
BTW - controls that show images in v10 have an image "AutoScale" property, (llok at the Image property in the FormDes) which means that it will automatically scale a loaded image to the DPI of the control at load time - this is done to better preserve the detail of the image because the image scaler used during the load is generally much better at resizing than the more basic (but faster) bitmap stretcher used at runtime. However, the image you sent me is something like 5000x2500px, and my main monitor is 200DPI which means it gets scaled to 10000x5000px. This uses a fair chunk of memory and can can slow things down as Windows allocates the memory for the bitmap, so it might be a good idea to turn off auto scaling for images like this.
Thanks
At 22 APR 2020 01:57PM Richard Richter wrote:
Hi Richard,
This is fixed for the next build of v10.0.8 - the image you sent me had a "rotate 180" orientation on it and it now displays as intended. SRP had contacted me a while back about JPEG rotation in v10, so I put the hooks in for it but never had an image to test with, so it never got fully completed.
BTW - controls that show images in v10 have an image "AutoScale" property, (llok at the Image property in the FormDes) which means that it will automatically scale a loaded image to the DPI of the control at load time - this is done to better preserve the detail of the image because the image scaler used during the load is generally much better at resizing than the more basic (but faster) bitmap stretcher used at runtime. However, the image you sent me is something like 5000x2500px, and my main monitor is 200DPI which means it gets scaled to 10000x5000px. This uses a fair chunk of memory and can can slow things down as Windows allocates the memory for the bitmap, so it might be a good idea to turn off auto scaling for images like this.
Thanks
Carl
Any idea when 10.0.8 will be released? Needless to say I'm waiting with baited breath. If you need someone to test fix, let me know I have several more pictures that display rotated and I can take more if necessary.
Thanks,
Richard Richter
At 22 APR 2020 02:00PM Richard Richter wrote:
Therefore this question is for anyone - How can I control the image rotation in OI 10.0.7?
I don't have a ready answer for you with regard to OI 10.0.7. AFAIK, it is supposed to automatically work with the OI 10.x Bitmap control. Just out of curiosity, is this a form and control that was converted from OI 9.x? If so, try creating a new form with a new Bitmap control and see if the problem is still evident. I'm wondering if the conversion process didn't update the Bitmap control completely.
You might also want to make sure this is the same problem as described in the blog article. I suggest downloading the JHEAD command line utility and run it as we documented it against a copy of your image. Then see if it displays corrects in the Bitmap control.
Don,
Thanks for your help and advice. the JHEAD utility works though it would be a bit cumbersome for a whole catalog of photos. I'm looking forward to the update.
Richard
Richard Richter
At 22 APR 2020 02:04PM Donald Bakke wrote:
Oh, I agree. I never meant for this to be a solution but rather just a way to confirm the actual problem so you can avoid chasing a red herring.