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

Closed
tdesvenain opened this Issue Jul 28, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@tdesvenain
Contributor

tdesvenain commented Jul 28, 2012

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

@tdesvenain

This comment has been minimized.

Show comment
Hide comment
@tdesvenain

tdesvenain Jul 28, 2012

Contributor

quoted code is PsdImagePlugin.py l 184

Contributor

tdesvenain commented Jul 28, 2012

quoted code is PsdImagePlugin.py l 184

@aclark4life

This comment has been minimized.

Show comment
Hide comment
@aclark4life

aclark4life Sep 8, 2012

Member

Please do submit a pull request!

Member

aclark4life commented Sep 8, 2012

Please do submit a pull request!

@tdesvenain

This comment has been minimized.

Show comment
Hide comment
@tdesvenain

tdesvenain Sep 21, 2012

Contributor

this was the pull request you have accepted. thanks !

Contributor

tdesvenain commented Sep 21, 2012

this was the pull request you have accepted. thanks !

@tdesvenain tdesvenain closed this Sep 21, 2012

wiredfool pushed a commit that referenced this issue May 24, 2014

Merge pull request #3 from hugovk/patch-1
Fix tests so image2 is resized and thumbnailed

wiredfool added a commit that referenced this issue Sep 20, 2015

@soorajsasi

This comment has been minimized.

Show comment
Hide comment
@soorajsasi

soorajsasi Dec 10, 2015

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment