Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, August 4, 2009 7:51:36 PM(UTC)

pyodok  
pyodok

Groups: Registered
Posts: 8


Hello~

I use LeadTools API version 15 from a c environment and I try to convert jpg to jpg (Resizing)
I have a question about it.

When I Convert jpg to different size jpg,
I want to know how the converting file's Comment maker(FFFE) value in JFIF format remains as unchanged.

I attached the file that used my test.

Thanks for your Help :)

pyodok attached the following image(s):
PicMsg_Sample1.jpg
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, August 5, 2009 5:02:38 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

I'm not sure what you mean by "comment maker".
JFIF files can contain a description comment and also IPTC comments. Are you trying to work with these comments? If yes, how exactly? If no, what do you want to do?

Also, does the image you attached contain the data you're asking about?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Tuesday, August 11, 2009 4:26:17 PM(UTC)

pyodok  
pyodok

Groups: Registered
Posts: 8


I apologize for the typos.
Please change "comment maker' to 'comment marker'.

You may also refer to "http://www.obrador.com/essentialjpeg/headerinfo.htm" for more information about 'comment marker'.

Attached image contain the comment.

I want to know how the converting file's Comment maker(FFFE) value in JFIF format remains as unchanged.
(When I Convert jpg to different size jpg,
I want to copy source file's Comment marker(FFFE) value in JFIF forrmat to result file )

It is following the process logic.

============================================================================

  BITMAPHANDLE hOutBitmap;   /* Bitmap handle to hold the Output image. */
  BITMAPHANDLE hInBitmap;    /* Bitmap handle to hold the Input image. */

  iRet = L_LoadBitmap("input.jpg", &hInBitmap, 0, ORDER_RGB, NULL, NULL)

   /* Define the dimensions for resizing */
   NewWidth = hInBitmap, .Width / 2;
   NewHeight = hInBitmap, .Height / 2;

   /* Initialize the new bitmap handle. */
   iRet = L_InitBitmap( &hOutBitmap, iWidth, iHeight, hInBitmap.BitsPerPixel );

   /* Allocate the storage to hold the image data. */
   iRet = L_AllocateBitmap( &hOutBitmap, TYPE_CONV );
 
   /* Duplicate the palette */
   iRet = L_CopyBitmapPalette(&hOutBitmap, &hInBitmap);

   hOutBitmap.ViewPerspective = hInBitmap.ViewPerspective;
   hOutBitmap.XResolution = hInBitmap.XResolution;
   hOutBitmap.YResolution = hInBitmap.YResolution;
   hOutBitmap.Order = hInBitmap.Order;

  iRet = L_ResizeBitmap (&hInBitmap, &hOutBitmap);

   /* Resize TmpBitmap to create LeadBitmap */
   iRet = L_SaveBitmap("out.jpg", &hOutBitmap, FILE_EXIF_JPEG, 0, 2, NULL)

=========================================================================

Thanks for your Help :)

 
#4 Posted : Tuesday, August 11, 2009 4:53:33 PM(UTC)

pyodok  
pyodok

Groups: Registered
Posts: 8


I am so sorry that I had a mistake of spelling before.
You could take "comment marker" instead of "comment maker"


Please check comment marker(FFFE) in the http://www.obrador.com/e...ntialjpeg/headerinfo.htm if you want to know the detail.


I'd like to keep the comment of the original file after resizing JPEG file.

There is the Jpeg Resizing processing logic I did below.

============================================================================

  BITMAPHANDLE hOutBitmap;   /* Bitmap handle to hold the Output image. */
  BITMAPHANDLE hInBitmap;    /* Bitmap handle to hold the Input image. */

  iRet = L_LoadBitmap("input.jpg", &hInBitmap, 0, ORDER_RGB, NULL, NULL)

   /* Define the dimensions for resizing */
   NewWidth = hInBitmap, .Width / 2;
   NewHeight = hInBitmap, .Height / 2;

   /* Initialize the new bitmap handle. */
   iRet = L_InitBitmap( &hOutBitmap, iWidth, iHeight, hInBitmap.BitsPerPixel );

   /* Allocate the storage to hold the image data. */
   iRet = L_AllocateBitmap( &hOutBitmap, TYPE_CONV );
 
   /* Duplicate the palette */
   iRet = L_CopyBitmapPalette(&hOutBitmap, &hInBitmap);

   hOutBitmap.ViewPerspective = hInBitmap.ViewPerspective;
   hOutBitmap.XResolution = hInBitmap.XResolution;
   hOutBitmap.YResolution = hInBitmap.YResolution;
   hOutBitmap.Order = hInBitmap.Order;

  iRet = L_ResizeBitmap (&hInBitmap, &hOutBitmap);

   /* Resize TmpBitmap to create LeadBitmap */
   iRet = L_SaveBitmap("out.jpg", &hOutBitmap, FILE_EXIF_JPEG, 0, 2, NULL)

=========================================================================

Each picture I attached contains the comment .
Let me know If you have a question.
I am looking forward to hearing from you.

 
#5 Posted : Tuesday, August 11, 2009 11:51:26 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Before saving the JPEG file, you need to load the Markers from the files by using the L_LoadMarkers function. Then, before saving the JPEG file using the L_SaveBitmap function, you need to set the markers by using the L_SetMarkers function.

Also, you can try to use the L_GetComment function to get the comment from the file before saing it. Then you can use the L_SetComment function to specify any of the comments that you want to save in a file header.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.260 seconds.