Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore committed Nov 6, 2024
1 parent 7f35ea9 commit 9fd2528
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 6 additions & 6 deletions config/vendor/imagemagick-6-policy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
-->

<!-- IiifPrint: allow more than default Ubuntu policy, re: RAM, Disk -->
<policy domain="resource" name="memory" value="512MiB"/>
<policy domain="resource" name="map" value="1GiB"/>
<policy domain="resource" name="width" value="20KP"/>
<policy domain="resource" name="height" value="20KP"/>
<policy domain="resource" name="area" value="128MB"/>
<policy domain="resource" name="disk" value="2GiB"/>
<policy domain="resource" name="memory" value="16GiB"/>
<policy domain="resource" name="map" value="32GiB"/>
<policy domain="resource" name="disk" value="200GiB"/>
<policy domain="resource" name="width" value="100KP"/>
<policy domain="resource" name="height" value="100KP"/>
<policy domain="resource" name="area" value="500GiB"/>

<policy domain="cache" name="shared-secret" value="passphrase"/>
<policy domain="coder" rights="none" pattern="EPHEMERAL" />
Expand Down
7 changes: 5 additions & 2 deletions lib/iiif_print/image_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ def im_identify_geometry(lines)

# @return [Array<String>] lines of output from imagemagick `identify`
def im_identify
cmd = "identify -format 'Geometry: %G\nDepth: %[bit-depth]\nColorspace: %[colorspace]\nAlpha: %A\nMIME type: %m\n' #{path}"
`#{cmd}`.lines
cmd = "identify -limit memory 8GiB -limit map 16GiB -limit disk 50GiB -format 'Geometry: %G\nDepth: %[bit-depth]\nColorspace: %[colorspace]\nAlpha: %A\nMIME type: %m\n' #{path}"
output, status = Open3.capture2(cmd)
Rails.logger.info "Identify command output: #{output}"
Rails.logger.info "Identify command status: #{status}"
output.lines
end

def im_mime(lines)
Expand Down

0 comments on commit 9fd2528

Please sign in to comment.