Uploaded image for project: 'Imaging'
  1. Imaging
  2. MGNLIMG-177

CachingImageStreamer might store incorrect jcr:mimeType

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 3.2.5
    • 3.2.4
    • None
    • Basel 30
    • 5

    Description

      DefaultImageGenerator and ImagingServlet (line ~98) used to hard-code the mime-type based on the imaging variation "outputFormat", which in many situations equals the filename extension:

      // we need to set mimetype here explicitly because extension (and type) is determined at runtime depending on what the image op chain does
      response.setContentType("image/" + outputFormat);
      

      This was not correct, in particular for the extension "jpg" (a valid file extension for JPEGs) the resulting mime-type image/jpg is not the correct mime-type for JPEGs* (which needs to be image/jpeg).
      While most browsers seem to cope with image/jpg, some (eg IE11) do not. The result is that image variations of jpg images are not displayed for us in IE11.

      Fix of MGNLIMG-171

      This problem was targeted with issue MGNLIMG-171 and now the ImagingServlet will correctly return the mime-type image/jpeg for extension "jpg" according to the given output format.

      Remaining todo

      However, CachingImageStreamer still persists cached images with the wrong property jcr:mimeType.

      This is not causing the output to be returned with the wrong mime-type as the servlet will still correctly determine the content-type from the output format, but this should be fixed nevertheless.

      See CachingImageStreamer line 220:

      imageData.setAttribute(FileProperties.PROPERTY_CONTENTTYPE, "image/" + generator.getOutputFormat(parameterProvider).getFormatName());
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                bandersen Bradley Andersen
                runger Richard Unger
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 3h
                      3h