Displaying a portrait image in KML without it being rotated to landscape - image

I am trying to reference images with a greater height than width (portrait format) in KML script for Google Earth; however, the image always comes out as landscape, or rotated left 90 degrees, e.g.
<img id="id_photo" src="2012_01_21-dscf03.jpg" width="500"></img>
I've tried everything I could think of. Is there a image tag to correct this, e.g., format="portrait"?
Thanks,
Walter

This sounds like an example of EXIF only rotation. Which GE probably doesn't honour.
Some cameras etc, 'rotate' a image so its the right way up by setting a flag in the EXIF data. The raw JPG itself, is still in the landscape format.
A display (or convert) program, should hopefilly notice this 'rotation required' flag, and rotate the image.
But Google Earth probably doesnt honor it, so you are just seeing the baseline image as its actully stored (unrotated)
Recommend trying one of the applications mentioned here:
http://jpegclub.org/losslessapps.html
(many note they have automatic correction - so should "fix" your jpg files)

This is already an old thread, but I stumbled on the same problem. And did not find a solution for my situation. Eventually I found a way around, so I thought I'd share it here.
Basically the solution is to rotate the offending images twice, once 90° to the left and then back again.
What you had was an image with a width larger than the height, but with an orientation tag that tells an application to rotate it 90° (but Google Earth does not).
After rotating it twice it is an image with width and height switched, and an orientation tag that says not to rotate it.
Now any application, including Google Earth, will display it correctly.
I used ExifTool to write the tags for all my images to a CSV file, created a list from that with all the pictures to rotate, and used that list to tell IrfanView twice to rotate them.

Related

Xlsxwriter rotate image

I am downloading a number of images to my local drive then adding them to a spreadsheet using insert_image(). The images are correctly oriented in Windows Explorer and other image viewing apps. However when I add an image (portrait) to the spreadsheet it becomes rotated to landscape. Landscape images do not appear to be rotated.
I also have a URL link for each image. When I click the image it opens up in a viewer in the correct orientation. It appears as if the insert_image is not respecting the image orientation. The EXIF information does not contain orientation.
Is there a way to specify image orientation, or rotate the image before inserting?
Thanks in advance,
Ian
Thanks for your help. That does seem to be the behaviour. xlsxwriter insert images in the ‘raw’ orientation of the image.
I was trying to insert images which have exif information, where all image are captured in the same orientation - in supported viewers exif flag is used in to rotate the image to the way the camera was oriented when taking the photo. I have solved the problem by applying the rotation to the image before inserting it into excel using xlsxwriter.

Powerpoint change picture without changing cropping area

I´ve a cropped picture in a powerpoint layer and I want to change the picture without changing the size of the cropping area.
If I change the image by clicking "change picture" the cropping area resizes too, to show the whole picture.
How can I do that without changing the cropping area?
In Apple Keynote you only have to drag the picture you want to the cropping area and you only have to align it.
From my experience, I'm afraid you have to set the crop manually by "Format Picture" -"Crop" to remain the same cropping area when you replace a picture.
This isn't much help, but Libreoffice will do this. Crop, resize, then select your image and re-insert a new image - formatting will be the same, perfect for when you want to quickly redo formatting for same sized images.
In my experience, a picture that you insert to replace an existing one, using Change Picture, will "inherit" the crop&size settings of the old picture IF the old&new images are actually of the same size (in pixels) - if not, the new one will revert to the default crop&size so you will have to redo these manually.
This changes if the image to-be-replaced has any crop setting applied to it in Powerpoint. In this case, the replacing image will not inherit those, and might also be inserted with a different size&position, leading most likely to an unwanted result & further work needed.
A workaround I found is to first remove the crop setting from the old picture, replace with new image, then reapply the crop. This is still less work than having to manually redo the size&position (or to define these based on numbers copied from the PropertiesPane of the old image).
Quick work around: if you plan to have multiple same size images and you wish to use change image to swap the content on each page (something we do with floor plans all the time); don't bother cropping them.
Put the whole image in and crop it by sticking shapes on top of it, which are the same color as the presentation background color, like a mask.
optionally crop the images only when the whole presentation is finished.

Images & Icons are getting pixelated when gallery loads

I have a Content Slider (All-in-one-banner sort of) on the home page of my website.
Every time this banner slides onto the next image in the queue, the other images (png format) on my page are getting pixelated. Especially it happens in Chrome.
Images and Icons such as the logos, icons used for navigation, etc... - they get pixelated when a new slide changes on the banner.
Please help me.
Demo link (Open in chrome):
When the slides in the banner change, Look at the logo on the top and the logos to the right, and also the profile pics below,: indiaemerge.com/ieys2013
The solution I could figure out is that one should NOT use an image with large dimensions.
For example: I was trying to use an image of size 800px X 400px to fit it into a division of 200px X 50px. Because of this the image was getting distorted when slides would change.
I reduced the dimensions and resolution of the image to match the target division's dimensions and it worked.
Another way to fix this is to use an svg image file.
So the lesson to be learnt here is that always try to use an image (in case it is png or jpg) whose size meets your requirement as precisely as possible. If it is an svg image file then there won't be any problem.

Handling size of image after orientation change WP7

I've got an Image with an overlay Canvas with some rectangles whose position is relative to image's size. The problem comes when I change the phone orientation, because image size changes (or at least, the renderization) but I can't manage to re-distribute the rectangles according to the new size, and the OrientationChanged event doesn't help me because it's fired before rendering the image (so all the rectangles go to (0,0))
Anyone can help me finding the correct event?
I'd either not use percentage widths or save them as exact values when first rendered/measured for one orientation. You can then adjust the dimensions relative to the orientation.
Update
If you can't get the exact values passed to you then you coudl load the image where teh user can't see it to measure it.
If you're getting the image and positions from an external source which always assumes a portrait orientation then why not just always display it as such in your app.
Finally got it!
The event I was looking for was the SizeChanged, I can't imagine how I didn't see it before...

Why is local image turned 90 degrees on UIWebView

I have an application that is set in landscape mode because of the content it contains. One of the things I want to do is take a picture of a piece of paper. I present the UIImagePickerController locked in portrait mode because it fits the paper size. After the user takes the picture I load that image as a background on a UIWebView. The reason I use a webview is because sometimes I need to load a .pdf there as well. Anyway, I'm setting the background using CSS. Here is the code...
//img is the path to an image.
myHtml = [NSString stringWithFormat:
#"<html><head>"
"</head>"
"<body><img src='%#'></body></html>", img];
[resume loadHTMLString:myHtml baseURL:baseURL];
The problem is, the image is displayed in landscape when the app returns to the UIWebView. Everything else is normal as far as text etc. Is there some reason that images are rotated 90 degrees to fit properly or something? I have tried pretty much everything with no luck.
The other thing is that we I retake a picture and reload the webView the old image remains.
You need to change the orientation of the image from its exif header if there is orientation info available in it. Identifying the picture orientation is the hard part, rotation of imgs can be done easily using css -webkit-transform: rotate(-90deg);
It does have to do with the exif data. While using a webkit transform may be ok for use in just the web view once, if you want to use the image later and have it always be the right orientation I'd use the categories given here:
http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
The article does a great job explaining exactly why the rotation occurs and the code does a nice job of 'fixing' the 'problem' so that you can then make use of the image without having to do extra things or worry about whether it'll be displayed correctly (even though the UIImageView takes the orientation into account).
You can resize with this to the same size it originally was, and it should fix the orientation issue.

Resources