17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/imagecache/converter.rb', line 17
def _convert(assetpath, conversions)
source = (conversions.length > 1) ? url_writer.write(conversions[0, (conversions.size - 1)], assetpath) : assetpath
destination = url_writer.write(conversions, assetpath)
if filesystem.exists?(destination)
data = filesystem.get(destination)
return data
elsif filesystem.exists?(source)
data = filesystem.get(source)
file = file(data)
metadata = identify.identify(file)
newdata = process(file, metadata, conversion)
newurl = url_writer.write(conversions, assetpath)
filesystem.set(newurl, converted.data)
return newdata
end
end
|