Skip to content

Instantly share code, notes, and snippets.

@teaforthecat
Created January 17, 2013 16:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teaforthecat/4557365 to your computer and use it in GitHub Desktop.
Save teaforthecat/4557365 to your computer and use it in GitHub Desktop.
dragonfly custom processor to create pyramidal tiff images to be used by iipsrv
class TileProcessor
def tile temp_object,tile_size=256
geom = "#{tile_size}x#{tile_size}"
temf = Tempfile.open('o.ptif')
`convert #{temp_object.path} -define tiff:tile-geometry=#{geom} -compress jpeg 'ptif:#{temf.path}'`
temf
end
end
tiled_images.processor.register(TileProcessor)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment