Uploaded image for project: 'Opencast'
  1. MH-11798

Binary files like PNG images in etc get corrupted during build

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed and reviewed
    • Affects versions: 2.2.2
    • Fix versions: 2.3.0
    • Components: Build System
    • Labels:
      None
    • Severity:
      Data Loss/Corruption
    • Steps to reproduce:
      Hide
      Steps to reproduce:
      1. Clone the community repository
      2. Run the maven build
      3. Compare etc/branding/watermark.png in source to etc/branding/watermark.png in any of the build packages (admin, allinone...)
      3.1. Look at the exact file size, the file is one byte smaller after build (md5sum also differs, obviously)
      3.2. Check the file with the console program "mediainfo" - you'll see that a lot of the metadata is missing in the file after the build
      3.3. Look at the first 8 bytes of the png file in a hex editor: Byte 5 (a carriage return) is missing. Look at http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.2 for the exact documentation of the png header. Chapter 8.2 also describes typical reasons for byte 5 getting stripped off.
       
      Actual Results:
      The png file can still be displayed by most image viewers, but further processing with ffmpeg (e.g. for using the image as a cover image) fails because ffmpeg doesn't recognize the file because of the corrupted header.
       
      Expected Results: The png file in the build package must be exaclty the same as it was in the source folder, it must not be altered in any way.
       
      Workaround (if any):

      Change <lineEnding>unix</lineEnding> to <lineEnding>keep</lineEnding> in assemblies/package.xml . The line ending conversion is what corrupts the png file.





      Show
      Steps to reproduce: 1. Clone the community repository 2. Run the maven build 3. Compare etc/branding/watermark.png in source to etc/branding/watermark.png in any of the build packages (admin, allinone...) 3.1. Look at the exact file size, the file is one byte smaller after build (md5sum also differs, obviously) 3.2. Check the file with the console program "mediainfo" - you'll see that a lot of the metadata is missing in the file after the build 3.3. Look at the first 8 bytes of the png file in a hex editor: Byte 5 (a carriage return) is missing. Look at http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.2 for the exact documentation of the png header. Chapter 8.2 also describes typical reasons for byte 5 getting stripped off.   Actual Results: The png file can still be displayed by most image viewers, but further processing with ffmpeg (e.g. for using the image as a cover image) fails because ffmpeg doesn't recognize the file because of the corrupted header.   Expected Results: The png file in the build package must be exaclty the same as it was in the source folder, it must not be altered in any way.   Workaround (if any): Change <lineEnding>unix</lineEnding> to <lineEnding>keep</lineEnding> in assemblies/package.xml . The line ending conversion is what corrupts the png file.

      TestRail: Results

        Attachments

          Activity

            People

            • Assignee:
              OlegBritvinFAU Oleg Britvin
              Reporter:
              OlegBritvinFAU Oleg Britvin
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                TestRail: Cases