Allow to get the raw image data without going over PIL.Image or NumPy

Đang mở Phù hợp với người mới
#110 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu trong sane.py với triển khai dev.snap() hiện có và các phương thức quét khác gọi start(). Cung cấp dữ liệu snapshot thô mà không yêu cầu PIL hoặc NumPy, đồng thời thêm raw_scan với cùng hành vi gọi start() trước khi chụp. Hoàn tất nghĩa là các bên gọi có thể lấy được các byte quét thô thông qua API công khai mà không cần một trong hai dependency tùy chọn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

So far there are two officially documented ways of getting image data after scanning: PIL.Image or NumPy array.

They both have their downsides. To only name one per package, PIL.Image lacks 48bit color support which limits all scans to only 24bit and a NumPy array is no image format. To get the data into something with proper image handling support (like a GdkPixbuf) this would have to be converted back to raw bytes, which makes the intermediate NumPy array useless.

Especially as both, PIL and NumPy, are optional dependencies, which are not enforced to use Python SANE, it would be nice to have some basic way to do a scan if neither PIL or NumPy are installed.

I'm currently developing a GUI scanning application in Python using the module, developed here. To do my scanning, I'll use "dev.snap()" which somewhat feels like an "undocumented internal function" but it does exactly what I need.

What I'm asking for is if it would be an useful addition to this module to expose "dev.snap()" in "sane.py" as "raw_snap" and add a convenience method "raw_scan" which, like the other "scan" methods, will call "start()" before calling "raw_snap". If so, I could prepare a Pull Request for this. I will keep using "dev.snap()" in the mean time as there is no useful alternative for now.

Ngôn ngữ chính
C
Star
61
Fork
22
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của python-pillow/Sane

Tất cả issue của python-pillow/Sane

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.