title: How to get original rendition of an image uploaded in DAM using AbstractImageServlet?
body: <p>We have written a custom servlet by extending the AbstractImageServlet and registered it against a custom selector and we are overriding the createLayer method . Returning a layer either from the image or after getting the layer from original rendition of the image does not return the original image and height of the image</p>
  
  <pre><code>Image img=new Image(imageContext.resource);
  Layer layer=img.getLayer(true, true, true);
  return layer;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>Resource imgResource = imageContext.request.getResourceResolver()
                  .getResource(imagePath);
          Layer layer=imgResource.getLayer(true, true, true);
          return layer;
  </code></pre>
  
  <p>where imagePath is the path of original rendition of the image</p>
  
  <p>The size of the original rendition of image in DAM is 2048 × 1100 and 220 KB</p>
  
  <p>but the size of the image returned by the servlet after getting the layer from the original rendition is 1280*687 and 292 KB</p>
  
  <p>The getLayer method of com.day.cq.wcm.foundation.Image class does not return the original rendition's exact same size.</p>
  
  <p>How can we get the original image's natural size a custom servlet extending the AbstractImageServlet ?</p>