[issue42916] Support for DICOM image file format in imghdr module

2022-03-13 Thread Irit Katriel


Irit Katriel  added the comment:

imghdr is deprecated as per PEP 594, so there won't be further enhancements to 
it.

--
nosy: +iritkatriel
resolution:  -> wont fix
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-04-12 Thread Ross Rhodes

Ross Rhodes  added the comment:

PR already open to support DICOM based on the first 132 characters. Marked 
“stale” since I haven’t had any feedback on GitHub, yet.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-04-11 Thread Pierre-Alain Moret


Pierre-Alain Moret  added the comment:

The DICOM format is indeed very widely used in the medical field and for me it 
deserves to be added in stdlib. I do not see why it is more specific than rast 
format which is included. Moreover it should be easy to add because even if the 
complete format is very complex with all the medical modalities, its enough to 
test the first 132 bytes of image that should be:
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00DICM'
 
Of course, its not enough to test that we have a valid DICOM image, but it is 
also not the case with other formats.

For example, with this simple corrupted jpeg image :
imghdr.what('dummy', h= 
b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\xff\xd9')
'jpeg' is returned.

That is why I strongly advocate in favor of adding DICOM format in imghdr.

Pierre-Alain Moret

--
nosy: +pam

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-02-08 Thread Ross Rhodes

Ross Rhodes  added the comment:

Looking for input from other contributors here. Naturally with a PR already 
open I’m inclined to keep these changes, but if the majority agree that it is 
too specific a format then I’m happy to hear alternative suggestions?

Ross

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-01-24 Thread Berker Peksag


Berker Peksag  added the comment:

Copying my comment from GitHub:

> I think DICOM is too specific to be added to the stdlib. I'd prefer
> improving documentation of imghdr.tests to make adding custom file
> types clearer.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-01-16 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hello Charles,

Following the format provided, I've opened a PR to implement your proposal. 
Feedback welcome.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-01-16 Thread Ross Rhodes


Change by Ross Rhodes :


--
keywords: +patch
nosy: +trrhodes
nosy_count: 2.0 -> 3.0
pull_requests: +23050
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24227

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-01-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Can you submit a patch, or post here an test_dicom function?

--
nosy: +terry.reedy
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42916] Support for DICOM image file format in imghdr module

2021-01-12 Thread Charles Law


New submission from Charles Law :

DICOM is a file format used frequently in medical imaging (it is also a 
communications protocol). It has been used since the 80's, and is still widely 
used by modern medical equipment.

It has a well defined format: 
http://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html

This proposal is for the addiction of a check to imghdr module to detect DICOM 
files, with imghdr.what() and return 'dicom' if a dicom file is found.

--
components: Library (Lib)
messages: 384989
nosy: claw
priority: normal
severity: normal
status: open
title: Support for DICOM image file format in imghdr module
type: enhancement
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com