NO

Author Topic: gdiplus  (Read 7248 times)

luojie

  • Guest
gdiplus
« on: January 18, 2015, 07:17:57 PM »
I used http://www.johnfindlay.plus.com/pellesc/GdiPlus.
to read and write exif part of jpg file.
reading exiftags  is very easy with the examples given.

but writing? I tried to modify the existing GpPropertyTagImageDescription in the original image.jpg file

   PROPERTYITEM buf;
   char propValue[32] = "modified description";
   buf.id = GpPropertyTagImageDescription;
   buf.value = propValue;
   if (  GpImage_SetPropertyItem(&image, &buf) == eOk)
   {
      MessageBox(NULL, "OK", "GpImage_SetPropertyItem", MB_OK);
                .......

it is eOk. but the image.jpg does not change: still the original image.jpg file...

I tried to use
GP_IMAGE GpImage_FromFile(const WCHAR * filename, BOOL useEmbeddedColorManagement)

it succeeded, but once again, it gives a copy of the original image.jpg file unmodified.

I don't know how tomake it.
could I have some hint to do it?

many thanks.

luojie

  • Guest
Re: gdiplus
« Reply #1 on: January 18, 2015, 09:24:16 PM »
I made a mistake: Iused
GpImage_SaveFile(&image, L"image.jpg", &encoderClsid, &encoderParameters);

as given in the example "SaveGdiPlusJpgImage"

luojie

  • Guest
Re: gdiplus
« Reply #2 on: January 18, 2015, 09:47:15 PM »
sorry, sorry.
everything is ok.
thanks to gdi+.