Sha256: 2965b4121e60d738c61474c45982995f0ee38aabcaf4a86a2344c53ca3185c9f

Contents?: true

Size: 880 Bytes

Versions: 56

Compression:

Stored size: 880 Bytes

Contents

require "active-fedora"
require "active_fedora_finders"
class StaticImageAggregator < ResourceAggregator
  
  CUL_WIDTH = "http://purl.oclc.org/NET/CUL/RESOURCE/STILLIMAGE/BASIC/imageWidth"
  CUL_LENGTH = "http://purl.oclc.org/NET/CUL/RESOURCE/STILLIMAGE/BASIC/imageLength"

  def route_as
    "image"
  end

  def index_type_label
    'PART'
  end

  def thumbnail_info
    candidate = nil
    max_dim = 251
    resources.each do |pid|
      resource = Resource.find(pid)
      if max_dim > resouce.long
        candidate = resource
        max_dim = resource.long
      end
    end
    if candidate.nil?
      return {:url=>image_url("cul_hydra/crystal/file_broken.png"),:mime=>'image/png'}
    else
      return {:url=>"#{ActiveFedora.fedora_config[:url]}/objects/#{candidate.pid}/datastreams/CONTENT/content",:mime=>candidate.datastreams['CONENT'].mimeType}
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
cul_hydra-1.8.0 app/models/static_image_aggregator.rb
cul_hydra-1.7.6 app/models/static_image_aggregator.rb
cul_hydra-1.7.5 app/models/static_image_aggregator.rb
cul_hydra-1.7.4 app/models/static_image_aggregator.rb
cul_hydra-1.7.3 app/models/static_image_aggregator.rb
cul_hydra-1.7.2 app/models/static_image_aggregator.rb
cul_hydra-1.7.1 app/models/static_image_aggregator.rb
cul_hydra-1.7.0 app/models/static_image_aggregator.rb
cul_hydra-1.6.4 app/models/static_image_aggregator.rb
cul_hydra-1.6.2 app/models/static_image_aggregator.rb
cul_hydra-1.6.1 app/models/static_image_aggregator.rb
cul_hydra-1.6.0 app/models/static_image_aggregator.rb
cul_hydra-1.5.3 app/models/static_image_aggregator.rb
cul_hydra-1.5.2 app/models/static_image_aggregator.rb
cul_hydra-1.5.1 app/models/static_image_aggregator.rb
cul_hydra-1.5.0 app/models/static_image_aggregator.rb
cul_hydra-1.4.18 app/models/static_image_aggregator.rb
cul_hydra-1.4.17 app/models/static_image_aggregator.rb
cul_hydra-1.4.16 app/models/static_image_aggregator.rb
cul_hydra-1.4.15 app/models/static_image_aggregator.rb