Skip to content

Can't identify some psd files because of layer mode type number #3

Description

@tdesvenain

On many psd i have tested, we have a layerinfo which layer image mode is 3

but code supports now mode type 65535, 0, 1 and 2

    for i in range(i16(read(2))):
        type = i16(read(2))
        if type == 65535:
            m = "A"
        else:
            m = "RGB"[type]

so we finally get a "can't identify image file..." exception

we supposed that mode 3 is "A", so if we write :

    for i in range(i16(read(2))):
        type = i16(read(2))
        if type == 65535:
            m = "A"
        else:
            m = "RGBA"[type]

and then it works very fine

i'll submit a pull request

Activity

  1. tdesvenain commented on Jul 28, 2012

    @tdesvenain
    ContributorAuthor

    quoted code is PsdImagePlugin.py l 184

  2. aclark4life commented on Sep 8, 2012

    @aclark4life
    Member

    Please do submit a pull request!

  3. tdesvenain commented on Sep 21, 2012

    @tdesvenain
    ContributorAuthor

    this was the pull request you have accepted. thanks !

  4. added a commit that references this issue on May 24, 2014
  5. added a commit that references this issue on Sep 20, 2015
  6. soorajsasi commented on Dec 10, 2015

    @soorajsasi

    hi,
    how to convert psd file to xml file in python

  7. added a commit that references this issue on Mar 15, 2019
  8. added a commit that references this issue on Oct 14, 2020
  9. added a commit that references this issue on May 12, 2022
  10. added a commit that references this issue on Jun 26, 2022
  11. added a commit that references this issue on Oct 11, 2022
  12. added a commit that references this issue on Dec 7, 2022
  13. added a commit that references this issue on May 24, 2023
  14. added a commit that references this issue on Sep 28, 2023
  15. added a commit that references this issue on Feb 5, 2024
  16. added a commit that references this issue on Mar 18, 2024
  17. added a commit that references this issue on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PSDAdobe Photoshop

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions