Skip to content

Commit

Permalink
Use sequential access mode when "VIPS_ACCESS_MODE=sequential"
Browse files Browse the repository at this point in the history
Couldn't find any other sane way of passing arbitrary options to this call
  • Loading branch information
Sam Stenvall committed Sep 2, 2019
1 parent 9ea1244 commit b3d21f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ class Decoder extends AbstractDecoder
*/
public function initFromPath($path): InterventionImage
{
return $this->initFromVips(VipsImage::newFromFile($path));
$options = [];

if ($accessMode = \getenv('VIPS_ACCESS_MODE')) {
$options['access'] = $accessMode;
}

return $this->initFromVips(VipsImage::newFromFile($path, $options));
}

/**
Expand Down

0 comments on commit b3d21f3

Please sign in to comment.