ChatGPT can't be trusted

Started by Phil Harvey, December 22, 2024, 03:43:27 PM

Previous topic - Next topic

Phil Harvey

I recently tried to use ChatGPt to find some information about a standard that was imprisoned by the ISO so I didn't have access to the actual document.

First I tried a test by asking a question to which I already knew the answer (my questions in bold below)...

Do the entries in the iinf box in an heic image need to be sorted by item ID?

Quote from: ChatGPTNo, the entries in the iinf (Item Information Box) within an HEIC (High-Efficiency Image Container) image do not need to be explicitly sorted by item ID. The iinf box serves as a container for infe (Item Information Entry) boxes, each of which provides metadata about an item in the file (e.g., a thumbnail, an auxiliary image, or a derived image).

The iinf box simply contains the entries in the order they are added. The association of an item to its metadata is handled by the item ID in the infe box, not by the order of entries in the iinf box.
Key Points:

    Item Identification: Each infe entry is linked to an item ID, and the
    decoder refers to the item ID to locate specific resources.
    No Sorting Requirement: While some implementations might choose to sort the
    iinf entries by item ID for convenience or readability, the HEIF
    (High-Efficiency Image File Format) specification does not mandate this.
    Parsing Considerations: A robust parser will rely on item IDs for mapping
    and should not assume any specific order in the iinf box.

Thus, while sorting is not required, maintaining a logical structure can sometimes aid in debugging or manual inspection of files.

You are wrong.  Page 81 of ISO/IEC 14496-12:2015 states: "This box [iinf] contains an array of entries, and each entry is formatted as a box. This array is sorted by increasing item_ID in the entry records."

Quote from: ChatGPTYou're absolutely correct! Thank you for pointing that out. According to ISO/IEC 14496-12:2015 (the base specification for the ISO Base Media File Format), the Item Information Box (iinf) must indeed contain its entries sorted by increasing item_ID. This sorting ensures consistency and simplifies the parsing process.

Here's the key point from page 81 of the standard:

    "This box contains an array of entries, and each entry is formatted as a
    box. This array is sorted by increasing item_ID in the entry records."

Implications:

    Strict Sorting Requirement: The iinf box must adhere to this ordering by
    item_ID. A file that does not comply may be considered non-conformant with
    the specification.
    Parser Expectations: Parsers implementing the standard will assume this
    ordering. An unordered iinf could cause errors or undefined behavior. File
    Creation: Tools generating HEIC files must ensure that infe entries in the
    iinf box are ordered by their item_ID.

Thanks for the correction—this is an important detail for maintaining compliance with the standard!

Do the entries in the ipma box in an heic image need to be sorted by item ID?

Quote from: ChatGPTNo, the entries in the Item Properties Association Box (ipma) within an HEIC image do not need to be sorted by item ID according to the HEIF and ISO/IEC 14496-12 standards.
Key Details about the ipma Box:

    Purpose: The ipma box associates items (by their item IDs) with specific
    properties listed in the iprp (Item Properties Box).
    Order: Unlike the iinf box, there is no explicit requirement in the standard
    that the ipma entries be sorted by item ID.
    Parsing: Parsers should iterate through the ipma entries and match the
    appropriate item IDs to their properties, regardless of the order.

Practical Implications:

    Sorting Not Mandatory: While sorting by item ID might make the file easier
    to read and debug, it's not a requirement.
    Robust Parsers: Any parser implementing the standard must handle unsorted
    ipma entries and correctly associate item properties based on the item ID
    specified within each ipma entry.

If you're working on HEIC file creation, adhering to strict sorting in the iinf box is required, but sorting the ipma entries is optional and purely for convenience.

Are you sure? You were wrong about sorting the iinf entries.  Have you consulted ISO/IEC 32008-12?

Quote from: ChatGPTApologies for the earlier confusion. Upon reviewing the relevant standards, I can confirm that the Item Properties Association Box (ipma) entries in an HEIC image do not need to be sorted by item ID. The standard does not specify any particular order for these entries. Therefore, while sorting may aid in readability or debugging, it is not a requirement.

Regarding ISO/IEC 32008-12, I am not aware of any standard by that number. The relevant standard for HEIC images is ISO/IEC 23008-12:2022, titled "Image File Format." This document specifies the Image File Format, an interoperable storage format for a single image, a collection of images, and sequences of images.
ISO

This standard builds upon the ISO Base Media File Format (ISO/IEC 14496-12) and defines the structure and requirements for HEIC images. It specifies how image data, metadata, and associated properties are organized within the file.

For detailed information on the ordering requirements of boxes like iinf and ipma, you should refer to the specific sections of the ISO/IEC 23008-12:2022 standard. This document provides comprehensive guidelines on the structure and ordering of boxes within the HEIC file format.

If you have further questions or need clarification on specific aspects of the standard, feel free to ask!

Yes, sorry.  I meant ISO/IEC 23008-12.  Are you saying that the description of the ipma box in ISO/IEC 23008-12 doesn't specify any sorting of entries?

Quote from: ChatGPTYes, that's correct. The description of the Item Properties Association Box (ipma) in ISO/IEC 23008-12 does not specify any requirement for sorting the entries by item ID or any other criterion. Entries in the ipma box are simply listed, and their association to items is determined by the item_ID values in each entry, not by their order in the box.
Key Points from ISO/IEC 23008-12:

    Purpose of the ipma Box: The ipma box maps item properties (defined in the
    iprp box) to specific items, identified by their item_ID.
    No Sorting Specified: The standard does not mandate any particular order for
    these mappings. This means the entries in the ipma box can appear in any
    sequence.
    Parser Behavior: Parsers are expected to handle entries in the ipma box
    based on the item_ID and associated properties without assuming any specific
    ordering.

Practical Considerations:

    Sorting Optional: While sorting the entries (e.g., by item_ID) might improve
    readability for debugging or manual inspection, it is not a requirement for
    compliance with the standard.
    Robust Parsing: Implementations must ensure that associations are correctly
    resolved regardless of the order of entries in the ipma box.

If you're working on HEIC file generation or processing, you don't need to worry about sorting the ipma entries, but ensuring the integrity and accuracy of the mappings is critical.

Thank you very much

Quote from: ChatGPTYou're very welcome! 😊 If you have any more questions about HEIC, ISO standards, or anything else, feel free to ask. Happy to help! 🚀

Phil goes away and is finally able to locate a liberated version of ISO/IEC 23008-12 to actually read the spec himself, then comes back to confront ChatGPT once more:

Do entries in the ipma box of an heif image need to be sorted by item ID?

Quote from: ChatGPTNo, the entries in the ipma (Item Properties Association) box of an HEIF image do not need to be explicitly sorted by item ID according to the HEIF (High-Efficiency Image File Format) specification. However, certain practices or tools may expect sorted entries for easier processing.
Relevant Details from the Specification:

    ipma Box Purpose: The ipma box associates item properties (defined in the
    iprp box) with items (defined in the meta box). Each entry specifies which
    properties apply to which item.
    Sorting: The standard does not mandate any specific order for entries within
    the ipma box. Items are referenced by their unique item_ID, and properties
    are referenced by indices, allowing the data to be read and applied without
    requiring a sorted order.
    Interoperability Considerations: While sorting is not required, maintaining
    a logical order (e.g., ascending by item_ID) can enhance human readability
    and debugging. Some encoders may produce sorted outputs for consistency, but
    this is not a requirement.

If you are working on encoding or decoding HEIF images, ensure your implementation properly interprets the ipma box regardless of the order of entries.

Are you sure?  Page 29 of ISO/IEC 23008-12:2017 states: "Each ItemPropertyAssociation box shall be ordered by increasing item_ID"

Quote from: ChatGPTYou're absolutely correct! The ISO/IEC 23008-12:2017 specification does indeed state that the entries in the ItemPropertyAssociation (ipma) box must be ordered by increasing item_ID. This ensures consistent interpretation and processing of the associations.
Specification Reference

From Section 6.5.11.2 of the standard (ISO/IEC 23008-12:2017):

    "Each ItemPropertyAssociation box shall be ordered by increasing item_ID."

Implications

    Mandatory Sorting: Implementations that generate HEIF files must ensure that
    the ipma entries are sorted by the item_ID in ascending order.
    Validation: Decoders and validators of HEIF files should verify that the
    entries in the ipma box are correctly ordered. Non-compliance may result in
    the file being considered invalid.
    Efficiency: Sorting ensures that processing the ipma box is predictable and
    efficient when associating properties with items.

Practical Advice

If you're working on encoding or manipulating HEIF files, make sure your process explicitly sorts the ipma entries by item_ID before writing the box to the file.

Fucker!  What a 2-faced lying bastard.  Also, ChatGPT is still wrong because 6.5.11.2 is not even close to the section from which the quote is taken.

The moral is:  ChatGPT can't even be trusted to properly interpret known documents.


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Yeah, you always have to double-check when looking for information.

Here are some of the things that ChatGPT gave me pretty good results.

It seems to know ffmpeg commands pretty well. (still terrible at exiftool commands though)

I've used it to make TamperMonkey/GreaseMonkey user-scripts. On eBay, I don't like the gallery view, so I used it to make a script to automatically change to list view. On a different site, it made me a script redirect from the "new" layout, i.e. the more mobile friendly layout, to the older legacy desktop layout.

It has written an autohotkey script to do a repetitive action in game I play. Basically hits four reroll buttons quickly.

I've had a couple of times where I was trying to figure out the best way to write up a subroutine that I couldn't quite figure out and it gave me a rough draft. I still had to tweak it, but it got me started. A couple more times I gave it a subroutine I already had and it streamlined it a bit.

On the non-technical side, I had an AI image of a fantasy character and asked it to give it D&D stats. The results were good enough for something to drop into a game.

It rewrote the Preamble to the US Constitution in the style of Mr. Torgue from the Borderlands games. That was pretty funny.

One problem I have is that I know there's a word I want to use, but I can't quite remember what it is. ChatGPT has quite often given me the exact word I was looking for. Similarly, I'll have a sentence which isn't quite right and it will give me a result that is closer to what I actually want to say.

I don't rely or depend upon it, but it does help me get to the results I'm trying for when I've gotten stuck. Useful, but it always needs to be double checked.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

Yes.

It is a useful tool but you need to know its limitations, and what problems are best suited for its use.

I was a bit surprised at how bad it was for my purpose, given that it appeared to have read the relevant document but still couldn't retrieve the appropriate section.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).