Alright, I'm slowly figuring this out with all of your help. I was a bit confused on the syntax of it all, but here is what I have going so far… “saveSectionToFile” is from the docs..
def saveSectionToFile(section, file_name):
'''Given a section, save it to a file.'''
section_file = file(file_name, "w")
section_file.write(section.contents())
section_file.close()
t = hou.node('/obj/hdaObj')
td = t.type().definition()
if td.hasSection('kittens.jpg'):
saveSectionToFile(td.sections().get('kittens.jpg'), 'C:/Users/clayton.krause/
Desktop/tmp/kittens.jpg')
Attached is the original jpg as well as the extracted. The original comes in at 50.6 KB, the extracted at 50.8 KB. The original isn't opening up as a jpg picture file should open up.
If anyone would mind explaining to me why the extracted jpg picture isn't opening up, that would help out a lot. I tried all the 3 compression types without any success-
Gzip
Blosc
NoCompression
Thank you all for any help in getting me to understand this better.
EDIT: I'd like to add that Photoshop posts with the following warning message when attempting to open the kittensExtracted.jpg
“Could not complete your request because an invalid DQT JPEG segment QTable number is found (it must be < 4)”