code: private function getXsendfileHeaders(ImageResource $resource, array $originalHeaders = [])
      {
          return array_merge($originalHeaders, [
              'content-disposition' => sprintf('inline; filename="%s"', basename($file = $resource->getPath())),
              'content-lenght' => filesize($file),
              'x-sendfile' => $file
          ]);
      }
docs: getXsendfileHeaders
  
  @param ImageResource $resource
  @param array $originalHeaders
  
  @return array