Your code looks correct to me; I'll download the image and give it a try on my 
end.



> On Jan 20, 2018, at 7:43 AM, Jordi Bares <[email protected]> wrote:
> 
> Thank you so much Larry… I have encountered a crash though… this is my 
> function when dealing with this particular image
> 
> https://github.com/openexr/openexr-images/blob/master/LuminanceChroma/StarField.exr
>  
> <https://github.com/openexr/openexr-images/blob/master/LuminanceChroma/StarField.exr>
> 
> And exists with an error likes this
> 
> Fatal Python error: deallocating None
> Abort trap: 6
> 
> 
> 
> THE CODE
> 
> ——————————————————8<———————
> 
> OK, BROKEN, SUSPICIOUS, UNKNOWN, SKIPPED, OTHER = range(0, 6)
> 
> def validateImageIntegrity(_filepath, _fastMode):
> 
>       imageMode = ''
>       result = OK
> 
>       # Exhaustive method of analysing images
>       image = oiio.ImageInput.open(_filepath)
>       spec  = image.spec()
> 
>       # If this is scanline mode
>       if spec.tile_width == 0:
>               imageMode = 'Scanline'
>               for y in range(spec.y, spec.y+spec.height):
>                       print 'inside scanline', y
>                       pixels = image.read_scanline(y, spec.z, oiio.UNKNOWN)
>                       if pixels == None :
>                               status = BROKEN
>       else:
>               imageMode = 'Tiled'
>               for z in range(spec.z, spec.z+spec.depth, spec.tile_depth):
>                       for y in range(spec.y, spec.y+spec.height, 
> spec.tile_height):
>                               for x in range(spec.x, spec.x+spec.width, 
> spec.tile_width):
>                                       pixels = image.read_tile(x, y, z, 
> oiio.FLOAT)
>                                       if pixels == None :
>                                               status = BROKEN
>       image.close ()
> 
>       return status
> 
> ——>8———————————————————————
> 
> 
> Am I missing something?
> 
> Thanks in advance and I hope it helps
> Jb
> 
> 
> 
>> On 19 Jan 2018, at 20:14, Larry Gritz <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> There's no built-in function to do this all in one step, but it's not hard 
>> to do "by hand".
>> 
>> I think the general approach is:
>> 
>> * Make an ImageInput, open the file
>> * For each tile of the image:
>>      * read_tile(), observe its return code (indicating error)
>>      * If an error occurs, the file is incomplete, note which tile is missing
>> 
>> 
>> 
>>> On Jan 19, 2018, at 2:48 AM, Jordi Bares <[email protected] 
>>> <mailto:[email protected]>> wrote:
>>> 
>>> Hello all,
>>> 
>>> My name is Jordi Bares and work for Framestore Advertising in the UK and I 
>>> hope I can contribute a bit on the OpenImageIO mailing list.
>>> 
>>> 
>>> My first question is, how can I do an sanity check on an image, specially 
>>> EXR images.
>>> 
>>> Is there any way to verify if an image has been properly closed and is well 
>>> formed? What about missing (black) tiles?
>>> 
>>> I don’t see anything in the documentation referring to that… am I missing 
>>> something?
>>> 
>>> 
>>> Thanks in advance.
>>> jb
>> 
>> --
>> Larry Gritz
>> [email protected] <mailto:[email protected]>
>> 
>> 
>> 
>> 
>> _______________________________________________
>> Oiio-dev mailing list
>> [email protected] <mailto:[email protected]>
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
> 
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

--
Larry Gritz
[email protected]




_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to