Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use im ping for efficiency #522

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions app/iiif_print/image_tool_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

# OVERRIDE IIIF Print v1.0.0

module IiifPrint
module ImageToolDecorator
# Add -ping option for efficiency
def im_identify
cmd = "identify -ping -format 'Geometry: %G\nDepth: %[bit-depth]\nColorspace: %[colorspace]\nAlpha: %A\nMIME type: %m\n' #{path}"
`#{cmd}`.lines
end
end
end

IiifPrint::ImageTool.prepend(IiifPrint::ImageToolDecorator)
19 changes: 19 additions & 0 deletions app/mini_magick/image/info_decorator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

# OVERRIDE MiniMagick v4.11.0

module MiniMagick
class Image
module InfoDecorator
def identify
MiniMagick::Tool::Identify.new do |builder|
yield builder if block_given?
builder << '-ping'
builder << path
end
end
end
end
end

MiniMagick::Image::Info.prepend(MiniMagick::Image::InfoDecorator)
3 changes: 3 additions & 0 deletions ops/production-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ extraVolumeMounts: &volMounts
- name: uploads
mountPath: /app/samvera/hyrax-webapp/public/branding
subPath: public-branding
# - name: uploads
#mountPath: /app/samvera/hyrax-webapp/tmp/uploads
#subPath: uploads

ingress:
enabled: true
Expand Down
3 changes: 3 additions & 0 deletions ops/staging-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ extraVolumeMounts: &volMounts
- name: uploads
mountPath: /app/samvera/hyrax-webapp/public/branding
subPath: public-branding
- name: uploads
mountPath: /app/samvera/hyrax-webapp/tmp/uploads
subPath: uploads


ingress:
Expand Down
Loading