This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

Notification

Icon
Error

Options
Go to last post Go to first unread
Franchi_S5  
#1 Posted : Monday, May 14, 2018 2:58:14 AM(UTC)
Franchi_S5

Rank: Advanced Member

Groups: Guest
Joined: 3/8/2018(UTC)
Posts: 45

Thanks: 21 times
Hi friends,

I continue with my project editing TIFF and JPEG images. I found what I think is a new bug.

As I told in another post, I use Jhove for digital objects validation. The problem now is with JPEG files.

If I validate the original JPEG, the result is OK. But when I edit the image with GM and then validate the output JPEG I have several error messages:

(Value offset not word-aligned: 133) and next.

Code:
<?xml version="1.0" encoding="utf-8"?>
<jhove xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://hul.harvard.edu/ois/xml/ns/jhove" xsi:schemaLocation="http://hul.harvard.edu/ois/xml/ns/jhove http://hul.harvard.edu/ois/xml/xsd/jhove/1.6/jhove.xsd" name="JhoveView" release="1.20.1" date="2018-03-29">
 <date>2018-05-14T11:00:36+02:00</date>
 <repInfo uri="E:%5CTEST%5CSALIDA%5C0005_cortada_con_error.jpg">
  <reportingModule release="1.4" date="2018-03-29">JPEG-hul</reportingModule>
  <lastModified>2018-05-11T09:57:29+02:00</lastModified>
  <size>438221</size>
  <format>JPEG</format>
  <version>1.01</version>
  <status>Well-Formed and valid</status>
  <sigMatch>
  <module>JPEG-hul</module>
  </sigMatch>
  <messages>
   <message offset="30" severity="info">Value offset not word-aligned: 133</message>
   <message offset="42" severity="info">Value offset not word-aligned: 189</message>
   <message offset="54" severity="info">Value offset not word-aligned: 197</message>
   <message offset="78" severity="info">Value offset not word-aligned: 205</message>
  </messages>
  <mimeType>image/jpeg</mimeType>
  <profiles>
   <profile>JFIF</profile>
  </profiles>

I use the next code for JPEG edition:

Code:
var exif = new Aurigma.GraphicsMill.Codecs.ExifDictionary();
var iptc = new Aurigma.GraphicsMill.Codecs.IptcDictionary();
                   
   if (procesar_exif == false)
   {
    exif = reader.Exif;
    exif.Remove(ExifDictionary.Thumbnail);
    writer.Exif = exif;
   }
   else
   {
    exif = reader.Exif;
    exif.Remove(ExifDictionary.Thumbnail);
    if (reader.Iptc != null) iptc = reader.Iptc;
    if (checkBoxEXIF.Enabled) writer.Exif = InsertarEXIF(exif);
    if (checkBoxIPTC.Checked) writer.Iptc = InsertarIPTC(iptc);
    if (reader.Xmp != null) writer.Xmp = reader.Xmp;
   }

then I crop and add a border to the input image as shown:

Code:
using (var borderColor = RgbColor.Black)
using (var generator = new ImageGenerator(crop.Rectangle.Width + (int)border_size * 2, crop.Rectangle.Height + (int)border_size * 2, reader.PixelFormat, borderColor))
using (var blender = new Blender())
{
if (resolution == 0)       // DON´T CHANGE INPUT RESOLUTION
{
blender.TopImage = reader.Frames[0] + crop;
blender.X = (int)border_size;
blender.Y = (int)border_size;
generator.DpiX = reader.DpiX;
generator.DpiY = reader.DpiY;
         try
         {
         Pipeline.Run(generator + blender + writer);
         crop.Dispose();
         exif.Dispose();
         iptc.Dispose();
         errorRectangulo = false;
         }
         catch (Aurigma.GraphicsMill.PipelineException e)
         {
         ShowErrorGM(e);
         }
}
else        // CHANGE INPUT RESOLUTION
{
float ratio = resolution / reader.DpiX;                                                     // RATIO CALC     
float border_size_tmp = border_size * ratio;                                         // APPLY RATIO TO BORDER
border_size = (int)border_size_tmp;
float Pixels_X = ((rectangulo.Width / reader.DpiX) * resolution);           //CALC SIZE FOR SCALE
float Pixels_Y = ((rectangulo.Height / reader.DpiY) * resolution);

generator.DpiX = resolution;
generator.DpiY = resolution;
generator.Width = (int)Pixels_X + (int)border_size * 2;
generator.Height = (int)Pixels_Y + (int)border_size * 2;
resize.Width = (int)Pixels_X;
resize.Height = (int)Pixels_Y;
resize.InterpolationMode = ResizeInterpolationMode.Medium;

blender.TopImage = reader.Frames[0] + crop + resize;
blender.X = (generator.Width - resize.Width) / 2;
blender.Y = (generator.Height - resize.Height) / 2;

     try
     {
      Pipeline.Run(generator + blender + writer);
      crop.Dispose();
      exif.Dispose();
      iptc.Dispose();
      errorRectangulo = false;
      }
      catch (Aurigma.GraphicsMill.PipelineException e)
     {
     ShowErrorGM(e);
     }
}
}

After this edition, the validation error is present. Even If I don´t change the EXIF or IPTC.

When I apply the same code adapted to TIFF images I have no validation errors, it only happens with JPEG files.

Attached input JPEG images: 0019.jpg

Attached output JPEG image: 0005_cortada_con_error.jpg

I need your help. Brick wall Thanks in advance. Angel

Eugene Kosmin  
#2 Posted : Monday, May 14, 2018 10:55:49 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Guest
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
Hi,

As I understand, these messages are informal, and they all have "info" severity. The overall status is "Well-Formed and valid".

Jhove shows me similar output for the same actions made in Adobe Photoshop. I think word-alignment missing is not a critical issue. My suggestion is to setup Jhove to ignore info messages.

Best regards,

Eugene Kosmin

The Aurigma Development Team

thanks 1 user thanked Eugene Kosmin for this useful post.
Franchi_S5 on 5/15/2018(UTC)
Franchi_S5  
#3 Posted : Tuesday, May 15, 2018 5:05:15 AM(UTC)
Franchi_S5

Rank: Advanced Member

Groups: Guest
Joined: 3/8/2018(UTC)
Posts: 45

Thanks: 21 times
Hi Eugene, thanks for your reply.

I really don't know how configure Jhove to ignore this info messages, and although the problem is the same when I edit the image with photoshop I'm sure that something is wrong in Photoshop too.

When we use another libraries (pure C# for example) we have not this problem.

I´m not saying that GM are bad libraries, not at all, but I almost would like to know what does that messages means to try repair the images. I really don't know what TAGS are bad aligned.

Thanks so much in advance.

Eugene Kosmin  
#4 Posted : Tuesday, May 15, 2018 4:48:48 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Guest
Joined: 9/19/2006(UTC)
Posts: 505

Was thanked: 41 time(s) in 41 post(s)
On this page, I see a logging level setting for Jhove. I'm not sure how you use it, but it might be helpful to try to change this value.

The problem is actually with EXIF saving. EXIF tags should be saved in TIFF format. TIFF format means that a value offset is expected to begin on a word boundary, i.e., to be an even number. But in practice, probably all modern software works fine even with unaligned offsets.

Anyway, we'll consider to implement it in future versions. Thanks for posting.

Best regards,

Eugene Kosmin

The Aurigma Development Team

thanks 1 user thanked Eugene Kosmin for this useful post.
Franchi_S5 on 5/15/2018(UTC)
Franchi_S5  
#5 Posted : Tuesday, May 15, 2018 5:17:15 PM(UTC)
Franchi_S5

Rank: Advanced Member

Groups: Guest
Joined: 3/8/2018(UTC)
Posts: 45

Thanks: 21 times
Thanks a lot Eugene.

I will learn about the JHOVE logging level configuration. I will appreciate if finally your team decide repair the unaligned offsets for JPEG images.

Best regards ;)

Users browsing this topic
Guest
Forum Jump  
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.