Hi Daniel,

Thx for the tip. Looks like it works indeed, but how do I get the list of
mipmap levels without loading the full file ? I can't find such information
in ImageInput
ImageBuf.nmiplevels contains the info I need, but by then the buffer has
already been loaded ...
And trying to read an invalid level makes the python interpreteur crash so
I can't "try first, ask for forgiveness afterwards"

Cheers,

2018-03-12 10:31 GMT+01:00 Daniel Flehner Heen <flehnerhee...@gmail.com>:

> Hi!
>
> I haven't done this my self, but in the docs for 1.8.x it says that
> ImageBuf  may be initialized with defined subimage and/or miplevel.
>
> buf = oiio.ImageBuf(filename, subimage, miplevel)
>
> Hope this helps
>
> On Mon, Mar 12, 2018 at 10:22 AM, Alexis PRAYEZ <apra...@brunchstudio.tv>
> wrote:
>
>> Hi all,
>>
>> New around here, even thou I worked with oiio occasionally over the last
>> years, but I'am kinda stuck.
>> Someone asked almost the same question a while ago (
>> http://lists.openimageio.org/pipermail/oiio-dev-openimageio.
>> org/2016-December/000832.html ) and the bottom line was
>>
>>>
>>> You can't "get an ImageBuf from an ImageInput", but you shouldn't need to
>>
>>
>> So it means I am probably doing something wrong:
>>
>> I am generating jpeg previews from hundreds of textures (exr, tx ...) and
>> this is painfully slow (the process is bound by network, as reading a 200mb
>> texture from the server is 10 times slower than doing the resizing.
>>
>> Since most of these textures have already been mipmapped, I would like to
>> only load the 512*512 mipmap level and write it back. But from what I
>> understood only ImageInput allows you choose what to load.
>> If I read all pixels from the ImageInput then "manually" create an
>> ImageBuf from it (requiring an extra numpy convert of the data) it works
>> but feel  a bit convoluted.
>>
>> Is there a better way to do this ?
>>
>> Cheers,
>>
>> --
>>
>> Alexis Prayez
>>
>> 41 rue de l'Echiquier - 75010 PARIS
>> <http://maps.google.com/maps?q=41+rue+%C3%A9chiqiuer+75010>
>> http://www.brunchstudio.tv/
>>
>> STATEMENT OF CONFIDENTIALITY
>> The information contained in this electronic message and any attachments
>> to this message are intended for the exclusive use of the addressee(s) and
>> may contain confidential or privileged information.
>> If you are not the intended recipient, you are hereby notified that any
>> dissemination, distribution or copying of this e-mail and any attachment(s)
>> is strictly prohibited. Please reply to the sender and destroy all copies
>> of this message and any attachments from your system.
>>
>> Please consider the environment before printing this e-mail.
>>
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>>
>>
>
>
> --
> -Daniel
>
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
>
>


-- 

Alexis Prayez

-- 

41 rue de l'Echiquier - 75010 PARIS 
<http://maps.google.com/maps?q=41+rue+%C3%A9chiqiuer+75010>
http://www.brunchstudio.tv/

STATEMENT OF CONFIDENTIALITY
The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain confidential or privileged information. 
If you are not the intended recipient, you are hereby notified that any 
dissemination, distribution or copying of this e-mail and any attachment(s) 
is strictly prohibited. Please reply to the sender and destroy all copies 
of this message and any attachments from your system. 

Please consider the environment before printing this e-mail.
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to