pub(super) fn read_chunk_itxt(
    info: &mut Info,
    zlibsettings: &DecompressSettings,
    data: &[u8],
) -> Result<(), Error> {
    /*Quick check if the chunk length isn't too small. Even without check
    it'd still fail with other error checks below if it's too short. This just gives a different error code.*/
    if data.len() < 5 {
        /*iTXt chunk too short*/
        return Err(Error(30));
    }

    let (key, data) = split_at_nul(data);
    if key.is_empty() || key.len() > 79 {
        return Err(Error(89));
    }
    if data.len() < 2 {
        return Err(Error(75));
    }
    let compressed_flag = data[0];
    if data[1] != 0 {
        return Err(Error(72));
    }
    let (langtag, data) = split_at_nul(&data[2..]);
    let (transkey, data) = split_at_nul(data);

    let decoded;
    let rest = if compressed_flag != 0 {
        decoded = zlib_decompress(data, zlibsettings)?;
        &decoded[..]
    } else {
        data
    };
    info.push_itext(key, langtag, transkey, rest)?;
    Ok(())
}
/*international text chunk (iTXt)*/
international text chunk (iTXt)
international text chunk ( iTXt )
pub(super) fn read_chunk_itxt(
    info: &mut Info,
    zlibsettings: &DecompressSettings,
    data: &[u8],
) -> Result<(), Error> {
    /*Quick check if the chunk length isn't too small. Even without check
    it'd still fail with other error checks below if it's too short. This just gives a different error code.*/
    if data.len() < 5 {
        /*iTXt chunk too short*/
        return Err(Error(30));
    }
    let (key, data) = split_at_nul(data);
    if key.is_empty() || key.len() > 79 {
        return Err(Error(89));
    }
    if data.len() < 2 {
        return Err(Error(75));
    }
    let compressed_flag = data[0];
    if data[1] != 0 {
        return Err(Error(72));
    }
    let (langtag, data) = split_at_nul(&data[2..]);
    let (transkey, data) = split_at_nul(data);
    let decoded;
    let rest = if compressed_flag != 0 {
        decoded = zlib_decompress(data, zlibsettings)?;
        &decoded[..]
    } else {
        data
    };
    info.push_itext(key, langtag, transkey, rest)?;
    Ok(())
}
pub ( super ) fn read_chunk_itxt ( info : & mut Info , zlibsettings : & DecompressSettings , data : & [ u8 ] , ) -> Result < ( ) , Error > { /*Quick check if the chunk length isn't too small. Even without check
    it'd still fail with other error checks below if it's too short. This just gives a different error code.*/ if data . len ( ) < 5 { /*iTXt chunk too short*/ return Err ( Error ( 30 ) ) ; } let ( key , data ) = split_at_nul ( data ) ; if key . is_empty ( ) || key . len ( ) > 79 { return Err ( Error ( 89 ) ) ; } if data . len ( ) < 2 { return Err ( Error ( 75 ) ) ; } let compressed_flag = data [ 0 ] ; if data [ 1 ] != 0 { return Err ( Error ( 72 ) ) ; } let ( langtag , data ) = split_at_nul ( & data [ 2 .. ] ) ; let ( transkey , data ) = split_at_nul ( data ) ; let decoded ; let rest = if compressed_flag != 0 { decoded = zlib_decompress ( data , zlibsettings ) ? ; & decoded [ .. ] } else { data } ; info . push_itext ( key , langtag , transkey , rest ) ? ; Ok ( ( ) ) }
international text chunk (iTXt)
international text chunk ( iTXt )
info
&mut Info
zlibsettings
&DecompressSettings
data
&[u8]