I'm looking for a way to extract/detect the ICC profile name of an image. I have no problem getting the profile itself - but how can I determine which profile it is.
Cheers
mattias
ICC profile name
Re: ICC profile name
Is this realy not possible?
Maybee someone can help me with pointers to th format of the ICC profile format? Does anyone have an idea of how one could parse it? Is it xml?
Cheers
Mattias
Maybee someone can help me with pointers to th format of the ICC profile format? Does anyone have an idea of how one could parse it? Is it xml?
Cheers
Mattias
Re: ICC profile name
Hi Mattias,
Here's pointer to the latest ICC spec. It's a binary format, not XML. Good luck!
http://www.color.org/icc_specs2.html
Here's pointer to the latest ICC spec. It's a binary format, not XML. Good luck!
http://www.color.org/icc_specs2.html
Re: ICC profile name
Thanks for the link.
sips (on os x) can do it: sips -g profile image.jpg
sips (on os x) can do it: sips -g profile image.jpg
Re: ICC profile name
So I read the specs and wrote this little test script. Have only tested it with a small number of files but it looks like its working.
Code: Select all
#!/usr/bin/env ruby -w
profile = Array.new
# Read the profile
data = IO.read 'profile'
# Read it into an array
data.each_byte { |b| profile.push(b) }
# Count the number of tags
tag_count = profile[128,4].pack("c*").unpack("N").first
# Find the "desc" tag
tag_count.times do |i|
n = (128 + 4) + (12*i)
ts = profile[n,4].pack("c*")
if ts == 'desc'
to = profile[n+4,4].pack("c*").unpack("N").first
t_size = profile[n+8,4].pack("c*").unpack("N").first
tag = profile[to,t_size].pack("c*").unpack("Z12 Z*")
puts tag.inspect
end
end
Re: ICC profile name
Is there a way to have same command for Linux?mattias wrote:Thanks for the link.
sips (on os x) can do it: sips -g profile image.jpg
Thanks!