How to save GPS info to an image's Properties

Dear All,
I am trying to save GPS information to an image, but I 've got an error message: "The parameter is incorrect. WinRT information: Cannot write to the specified property (System.GPS.Latitude). The property is read-only."
Could you please help me to find out what's the wrong with my source code?
And is System.GPS.Latitude a read-only property? How can I change the property to read/write?
double GPSLatitude = 25.125965;
List<string> propertiesName = new List<string>();
propertiesName.Add("System.GPS.Latitude");
IDictionary<string, object> extraProperties = await photoStorageFile.Properties.RetrievePropertiesAsync(propertiesName);
extraProperties.Add("System.GPS.Latitude", GPSLatitude);
await photoStorageFile.Properties.SavePropertiesAsync(extraProperties);
Thanks,
Angie

I'm trying to achieve the same result, but using a BitmapEncoder.
The Latitude works fine but I just can't seem to get the Longitude to write to the file correctly.
(All the other properties are working fine.)
The inputStream is from the webcam via a capture control.
Pretty sure the decoder would behave the same if inputStream was from an StorageFile though.
Any ideas please?
Windows.Storage.Streams.IRandomAccessStream outputStream = await imageFile.OpenAsync(FileAccessMode.ReadWrite);
var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(inputStream);
BitmapEncoder encoder = await Windows.Graphics.Imaging.BitmapEncoder.CreateForTranscodingAsync(outputStream, decoder);
BitmapPropertySet bitmapPropSet = new BitmapPropertySet();
bitmapPropSet.Add("System.Subject", new BitmapTypedValue(txtPhotoSubject.Text.Trim(), PropertyType.String));
bitmapPropSet.Add("System.GPS.LatitudeNumerator", new BitmapTypedValue(new int[3] { 47, 38, 24471 }, PropertyType.Int32Array));
bitmapPropSet.Add("System.GPS.LatitudeDenominator", new BitmapTypedValue(new int[3] { 1, 1, 1000 }, PropertyType.Int32Array));
bitmapPropSet.Add("System.GPS.LatitudeRef", new BitmapTypedValue("E", PropertyType.String));
bitmapPropSet.Add("System.GPS.LongitudeNumerator", new BitmapTypedValue(new int[3] { 122, 7, 470316 }, PropertyType.Int32Array));
bitmapPropSet.Add("System.GPS.LongitudeDenominator", new BitmapTypedValue(new int[3] { 1, 1, 10000 }, PropertyType.Int32Array));
bitmapPropSet.Add("System.GPS.LongitudeRef", new BitmapTypedValue("N", PropertyType.String));
await encoder.BitmapProperties.SetPropertiesAsync(bitmapPropSet);
await encoder.FlushAsync();
Here's the resulting properties...
EDIT (2nd Oct 2013)
Only thing that seems to fix the issue is to not include the LongitudeDenominator property.
Commenting out that line works ok.
I also needed to leave the LatitudeDenominator as 1,1,1 and just include the whole seconds.
Close enough.

Similar Messages

  • How to save a hidden window to image in PWF

    I want to convert a xaml to a png image using c#. I used RenderTargetBitmap. It works quite well if the xaml that's meant to be converted is displayed in a window or a page and you can actually see it on screen. But if the window is closed or hidden, a
    blank image will be generated. Does anyone know why this happens or how to make it work?

    Hello yf11,
    You can refer to the following MSDN article:
    https://msdn.microsoft.com/en-us/library/aa969819(v=vs.110).aspx
    How to: Encode a Visual to an Image File
    // The BitmapSource that is rendered with a Visual.
    RenderTargetBitmap rtb = new RenderTargetBitmap(bi.PixelWidth, bi.PixelHeight, 96, 96, PixelFormats.Pbgra32);
    rtb.Render(drawingVisual);
    // Encoding the RenderBitmapTarget as a PNG file.
    PngBitmapEncoder png = new PngBitmapEncoder();
    png.Frames.Add(BitmapFrame.Create(rtb));
    using (Stream stm = File.Create("new.png"))
    png.Save(stm);
    In this way you can save the image at a certain time when your window is still showing.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to save JavaFX chart s as images

    how to save javafx charts as images. please help me in this.
    thanks in advance

    Here is my pie2D chart. how to svae it as image file
    Stage {
    title: "Pie Chart"
    scene: Scene {
    content: [
    PieChart {
    title: "What Is Your Favorite Pie?"
    titleFont: Font { size: 24 }
    data: [
    PieChart.Data {
    value: 21
    label: "Pumpkin"
    PieChart.Data {
    value: 33
    label: "Apple"
    PieChart.Data {
    value: 17
    label: "Cherry"
    PieChart.Data {
    value: 29
    label: "3.14159"
    }

  • How to save, combine and retrieve the images on hard drive using IMAQ in labview

    Hi,
    I am using NI-1426 frame grabber to capture images of 800x1 resolution with 270 bands. Actually, I want to capture images from camera and saving into the hard drive continuously so that my buffer does not run out of memory.  After capturing say 100 images of same resolution (800x1), I want to combine all images into ENVI format and then again save on hard-drive. Please guide me how can I do that?
    Thanks
    Sidd 

    Hi Jeff,
    Let me explain it in little detail.
    I am using PCI NI-1426 frame grabber to capture the images at particular frame rate. Ni-1426 has 2 ports i.e. 26 pin camera and 15 pin triggering port. I am sending the pulse per second (pps) signal from gps to the triggering port. I want to check for the pps signal through the frame grabber 15 pin port. Please tell me how can I listen to a trigger through a frame grabber in labview? As I have connected pps signal on pin1 in 15 pin port, I want to read that pin. or how can I read a particular  pin data in labview? I have already checked that I am getting pps signal through oscilloscope.
    Thanks
    Regards,
    Sidd 

  • How to: Save many PDF files containing images as jpeg

    I have a whole lot of PDF files that only contain images. I need them to be in jpeg format however.
    To convert them I'd need to open all theses pdf files in Preview and then "save as" jpeg. This does the job wonderfully.
    But it only does so for one pdf/image at a time. There's no way I can do this for all the files.
    I need to preserve the pdf files' names, too, so I can't combine the files and insert them into one pdf. This would result in having jpegs all right, but with names that do not represent the original file names.
    How can I batch process this with Preview?
    I tried the Automator but haven't found any way of doing it there.
    Does anyone have an idea how to accomplish that?

    Hi PPAC,
    What version of Windows are you running? I found another thread about this particular issue, with two possible solutions. One is to make sure that you're logged in as an administrator, and the other is to change the compatibility to earlier version of Windows. (Right-click the Acrobat application icon, choose Properties, and then choose compatibility.)
    I'm also curious what export settings you're choosing when you save as JPEG...
    Best,
    Sara

  • With JDIC WebBrowser, how to save the content as an image ?

    I wonder if there is a way to save the WebBrowser's content (Html page with graphics) into a *.png image file ? The html page may span several screens, if I do a screen shot, I can only get the top part which I can see, but will miss the off screen contents. What I mean is : if the page is 900(W) x 3500(H) pixels, how to ask my java program to take a screen shot which can get the whole image of the WebBrowser content, including those off the bottom of the screen ?
    I was able to do this with the following method for JComponent
      public static BufferedImage Get_JComponent_Image(JComponent J_Component,Rectangle region) throws IOException   // Create a BufferedImage for Swing components. All or part of the component can be captured to an image.
       /* @param J_Component Swing component to create image from
        * @param region The region of the component to be captured to an image
        * @return image the image for the given region
        * @exception IOException if an error occurs during writing
        boolean opaqueValue=J_Component.isOpaque();
        J_Component.setOpaque(true);
        BufferedImage image=new BufferedImage(region==null?J_Component.getWidth():region.width,region==null?J_Component.getHeight():region.height,BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d=image.createGraphics();
        g2d.setClip(region);
        J_Component.paint(g2d);
        g2d.dispose();
        J_Component.setOpaque(opaqueValue);
        return image;
      }So I tried to modify this method to work for Component (since WebBrowser is a sub-class of it), I got black screen with the following modified method :
      public static BufferedImage Get_Component_Image(Component A_Component,Rectangle region) throws IOException   // Create a BufferedImage for Swing components. All or part of the component can be captured to an image.
       /* @param A_Component AWT component to create image from
        * @param region The region of the component to be captured to an image
        * @return image the image for the given region
        * @exception IOException if an error occurs during writing
        boolean opaqueValue=A_Component.isOpaque();
        Out("opaqueValue="+opaqueValue);
    //    A_Component.setOpaque(true);
        BufferedImage image=new BufferedImage(region==null?A_Component.getWidth():region.width,region==null?A_Component.getHeight():region.height,BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d=image.createGraphics();
        g2d.setClip(region);
        A_Component.paint(g2d);
        g2d.dispose();
    //    A_Component.setOpaque(opaqueValue);
        return image;
      }Can anyone tell me what I did wrong ? Thanks.
    Frank

    Hi,
    Even im looking for the same thing. I tried createImage on the panel but its giving me a blank screenshot, which i presume does not works on the embedded IE area and gives the blank screenshot of the jPanel behind it.
    Kindly post any solution you might have come up with.
    Thanx

  • How to save Bridge info (ie collections) before system re-install

    I am about to do a clean install of my XP system.
    I currently have Bridge CS4, and have saevd a number of collections.
    How can i save the collection information so that once I have done a clean system install and reinstalled Bridge that I can reinstate the bridge data so that I will still have access to all of my collections. I don't want to save the collections out to folders, as this defeats the point of having the collections!
    I may also upgrade to CS5 (if that has any influence on the answer).

    wel, I wouldn't say that there is 'nothing' to save. If I don't do anything, I will loose all of my collections. this is valueable information that I need (for example, collections for online portfolios, etc, which link to files all over my catalogue).
    I am hoping to find out which exact config files i need to ensure i have so that I can make sure I don't loose this information. I will be able to keep the harddrive letters the same, so the paths won't change.
    As for upgrading to windows 7 64bit, 8 GB RAM - this is on the cards, but not for another 6-9 months, and will be brand new machine.
    Reinstall is required for now, as XP is slowly grinding to a halt. Has been 3 years since last clean install. And I need to keep this machine ticking along for the time being.
    Can anyone confirm exactly what settings files i need to grab to ensure i don't loose my collections?

  • Reinstalling OS - how to save iTunes info

    Due to a bug I have to reinstall my OS, which of course means I will lose all info. Copying to an external HD is no problem, but I spend quite a lot time in making playlist and getting all names of songs and artits correct, so I don't want to do this all over again.
    If I do Archive > Library > make reservecopie on disc will ALL (songs, playlists,...) the info be copied and saved? And to I need the .xml file that is created when I export my library?

    Chris CA wrote:
    But that's not what he should do since he is having a problem with the current system.
    just testing, Chris ...
    so, here's the walkthrough for restoring selected items: http://web.me.com/pondini/Time_Machine/15.html.
    JGG

  • Images missing GPS info in photo library

    hey everyone,
    I've been using iPhone taking picture and screenshot, import images from other app like GoPro App, wechat, etc,
    I'm pretty sure before not only the photo taken by iPhone build-in camera has the GPS info, the rest image also has that GPS information, it was before my recently update.
    Now i'm using iPhone 5 with Macbook iPhoto 9.6.1, all the images except those taken by iPhone build-in camera are missing the GPS info!!
    Can anyone tell me what just happened? is that update really did something, or there is an setting I can bring them back?
    thanks for the answer..

    yeah only by two years but as there was over 100 views and no one bothered their backsides to reply with a "constructive comment" i decided to be helpful for the next 100 people that view this page. they will also see this comment and ur last snarky one. so good for u! (i wish there was a ******* emoticon to place here)
    i never actual use these forums, only came across this Q while browsing google for some developer info on ios gps dictionary keys and why ios when taking pics wont use the gps acquired date/time for the kCGImagePropertyGPSDateStamp//kCGImagePropertyGPSTimeStamp in photo meta tag fields even tho it has the gps co-ords stored. i'll stick stackoverflow so
    no point asking wjosyen thats for sure even with his level 9(?) because god knows what useless comment he will reply with (so in these discussions boards can u win points in give-aways or in follow the dots drawing competitions?)
    joking aside, be serious now, u got them points somehow, u must be in some way clued in so why bother commenting here like that if u cant be helpful wjosten? in future just provide a more helpful answer if u can, if not dont bother, really!!

  • (mapviewer) how to save map as an image

    I open a mapviewer in web page, and load a map.
    I wonder how to save this map as an image?
    thx
    tamsun

    Hey, I was wondering how I could save my graphics as an image,Don't know if you can save Graphics as an Image, but you can draw a JComponents image to an Image. Search the forum using "screenimage" to find my class that does this.

  • GPS info in EXIF data

    I have read the threads regarding GPS data and Aperture. I understand how to insert GPS info in the raw files and then import that file into Aperture.
    Is there a way to add GPS info (latitude and longitude) into an existing Aperture image or library without having to re-import the file? I don't want to do this for every image I have, but I would like to do it for my favorites that show up on my web site. I would prefer not to lose all of the adjustments for images that I have already slaved over.

    Hello Kjell,
    maybe you give gpsphotolinker a try. Before you
    import your Fotos into Aperture you can manipulate
    the exif with this app.
    link->
    http://oregonstate.edu/~earlyj/gpsphotolinker/index.ph
    p
    best regards
    marek
    Germany
    Powerbook G4 1,67 GHz  
    Mac OS X (10.4.7)  
    Thanks for the tip. However, I do not shoot jpeg images, and would like a solution that supported my RAW/Aperture workflow - hopefully letting me avoid having to export my entire library out and re-importing it in again after the work is done.
    Ideally, I would like a solution that would enable to to update my Aperture library from time to time using location information from a set of .gpx files, and for that to work, I would need some piece of sw that let me read out exif date/time data and compare with the same data in .gpx files and write back appropriate data when a date/time match is found.
    However - not sure if Aperture would allow me to write exif data into the library at present?
    Kjell Are Refsvik
    Norway

  • Automatically save all poster points as images

    I understand how to save a frame as an image by doing Timeline/Save Frame As File, but I would like to save an image for each posterpoint in my home movies as a simple reference as to what is on the dvd.
    What is the easiest way to save 24 posterpoint frames as images?
    I am using Encore CS3 (3.0.1.008)
    Thanks!

    Any such script would fail with a error once it tried to exceed Photoshop 53 Alpha Channel limit.  If a document had 53 alpha channels to begin with the script would fail saving the first alpha channel it would try to save.  I know this for a have a script that tries to create my kind of collage template PSD files that has no Image layers but has alpha channels to map the locations where images will be populated.  I had to program the script to catch that there were more the 53 prototype image layers.
    IMO with the exception of the background layer all layers have Alpha Channel its actual pixel map. This invisible Alpha channel maps the layers actual pixels locations and is used in conjunction with any enable layer masks when pixels are rendered for the layer.  What I was trying to do was to create a collage template that had Alpha channel to map the locations of where Image would be placed. . I would open a document the size and resolution I wanted the collage to have. Then add an empty layer the use a selection tool to make a 4"x6" selection and fill with pixels..  Duplcate that layer for as many image I wanted. And I would position the layer where I want the image to be located.  I would then  run the script.  It would save Alpha channels for each image location and at the end flatten the layer image prototype stack to stamp the image locations onto the required background layer.  Once I reached 54 image layers  the script failed and I realized that my Collage Scripts and templates were limited to a maximum of 53 images.

  • How to save info in a meta-data of a jpg file?

    hi, i need to know how to save info in a meta-data of a jpg file:
    this is my code (doesn't work):
    i get an exception,
    javax.imageio.metadata.IIOInvalidTreeException: JPEGvariety and markerSequence nodes must be present
    at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeNativeTree(JPEGMetadata.java:1088)
    at com.sun.imageio.plugins.jpeg.JPEGMetadata.mergeTree(JPEGMetadata.java:1061)
    at playaround.IIOMetaDataWriter.run(IIOMetaDataWriter.java:59)
    at playaround.Main.main(Main.java:14)
    package playaround;
    import java.io.*;
    import java.util.Iterator;
    import java.util.Locale;
    import javax.imageio.*;
    import javax.imageio.metadata.IIOMetadata;
    import javax.imageio.metadata.IIOMetadataNode;
    import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
    import javax.imageio.stream.*;
    import org.w3c.dom.*;
    public class IIOMetaDataWriter {
    public static void run(String[] args) throws IOException{
    try {
    File f = new File("C:/images.jpg");
    ImageInputStream ios = ImageIO.createImageInputStream(f);
    Iterator readers = ImageIO.getImageReaders(ios);
    ImageReader reader = (ImageReader) readers.next();
    reader.setInput(ImageIO.createImageInputStream(f));
    ImageWriter writer = ImageIO.getImageWriter(reader);
    writer.setOutput(ImageIO.createImageOutputStream(f));
    JPEGImageWriteParam param = new JPEGImageWriteParam(Locale.getDefault());
    IIOMetadata metaData = writer.getDefaultStreamMetadata(param);
    String MetadataFormatName = metaData.getNativeMetadataFormatName();
    IIOMetadataNode root = (IIOMetadataNode)metaData.getAsTree(MetadataFormatName);
    IIOMetadataNode markerSequence = getChildNode(root, "markerSequence");
    if (markerSequence == null) {
    markerSequence = new IIOMetadataNode("JPEGvariety");
    root.appendChild(markerSequence);
    IIOMetadataNode jv = getChildNode(root, "JPEGvariety");
    if (jv == null) {
    jv = new IIOMetadataNode("JPEGvariety");
    root.appendChild(jv);
    IIOMetadataNode child = getChildNode(jv, "myNode");
    if (child == null) {
    child = new IIOMetadataNode("myNode");
    jv.appendChild(child);
    child.setAttribute("myAttName", "myAttValue");
    metaData.mergeTree(MetadataFormatName, root);
    catch (Throwable t){
    t.printStackTrace();
    protected static IIOMetadataNode getChildNode(Node n, String name) {
    NodeList nodes = n.getChildNodes();
    for (int i = 0; i < nodes.getLength(); i++) {
    Node child = nodes.item(i);
    if (name.equals(child.getNodeName())) {
    return (IIOMetadataNode)child;
    return null;
    static void displayMetadata(Node node, int level) {
    indent(level); // emit open tag
    System.out.print("<" + node.getNodeName());
    NamedNodeMap map = node.getAttributes();
    if (map != null) { // print attribute values
    int length = map.getLength();
    for (int i = 0; i < length; i++) {
    Node attr = map.item(i);
    System.out.print(" " + attr.getNodeName() +
    "=\"" + attr.getNodeValue() + "\"");
    Node child = node.getFirstChild();
    if (child != null) {
    System.out.println(">"); // close current tag
    while (child != null) { // emit child tags recursively
    displayMetadata(child, level + 1);
    child = child.getNextSibling();
    indent(level); // emit close tag
    System.out.println("</" + node.getNodeName() + ">");
    } else {
    System.out.println("/>");
    static void indent(int level) {
    for (int i = 0; i < level; i++) {
    System.out.print(" ");
    }

    Hi,
    Yes, you need store data to table, and fetch it when page is opened.
    Simple way is create table with few columns and e.g. with CLOB column and then create form based on that table.
    Then modify item types as you like, e.g. use HTML editor for CLOB column
    Regards,
    Jari

  • How to save info in 'File Info.' Can't find a way

    I edit a photo in Photoshop CC. I want to save its information in 'File Info' so that I don't need to retype all of it over and over again. I could do that in my old Photoshop app. Every time I try it now, it doesn't save and I end up retyping. When you have 20 photos edited, that takes a huge amount of unnecessary time. How do I save 'File Info?"

    I'm assuming you mean "file info...", under the file menu item. After adding information, be sure you click "OK" in the bottom right of the info window, and then of course be sure to, in turn, save the entire image to your hard drive. It worked for me every time, so I don't think there is a bug.

  • How can I configure the save page mode (to save DEFAULT WITH OR WITHOUT images and other dependencies in a folder)?

    I like it that I can save webpages with or without dependencies in a separated folder. And its implementation in Firefox (e.g. it remembers how I saved something before, and that way becomes the default) can also be good sometimes. But usually it is not.
    Usually I want to save pages as HTML-only. Sometimes, but only sometimes I have to save a page as a whole (I don't know the name of the feature). But after I save something with dependencies, I often forget that, and don't care about this option. Firefox, however, doesn't forget it, and saves thousands of unimportant images, until I notice it and switch it off again.
    This is not good.
    I tried Google Chrome, which simply don't remember how I saves something before, and always select the complete page option for default. It is exactly the opposite of the perfect solution (in my opinion). The best would be if the browser would save everything as HTML only, if I don't change it. Or it would be even better if I could configure it manually (turn this remembering feature on/off).
    This is not a beginner's problem, so it would be good if only a config option solved this. I imagine that already exists a config option for this, but I could not find it. I found only the "browser.download.save_converter_index" option, which depends on how I used it last time.
    Is there a config option for this? Or should I report this in the Firefox brainstorm page?
    Thank you for your time
    D. J. S.

    That choice is remembered in the Integer pref <b>browser.download.save_converter_index</b>
    0: Web Page, complete (default)
    1: Web Page, HTML only
    2: Text files
    If you want to reset that choice to HTML only on every start of Firefox then you can use this line in the file [http://kb.mozillazine.org/user.js_file user.js]
    <pre><nowiki>user_pref("browser.download.save_converter_index", 1);
    </nowiki></pre>
    See also http://kb.mozillazine.org/Editing_configuration#How_to_edit_configuration_files

Maybe you are looking for