Comments (8)
I found out that in Python 3.13 imghdr
was removed.
Important deprecations, removals or restrictions:
PEP 594: The remaining 19 “dead batteries” have been removed from the standard library: aifc, audioop, cgi, cgitb, chunk, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu and xdrlib.
And PEP 594 gives the below advice:
imghdr: use the projects filetype, puremagic, or python-magic instead. (Contributed by Victor Stinner in gh-104773.)
I will switch to Python 3.12, but you might want to update the library to support future version of Python!
Thank you!
from md2pptx.
Hi @Mukei. First, thank you for your bug report. I take currency seriously - but haven't seen benefits in 3.12 or 3.13 for this project. Nevertheless it needs to run.
I discovered an issue with 3.12 - which I aim to get a fix out for soon. Another deprecated behaviour going away, of course.
I actually had trouble getting a 3.12 install to find python-pptx - but obviously I need to fix that.
What I think the current use of imghdr
is to recognise the dimensions (really proportions) of an image and its type. I'll have to see how I can replicate that function - preferably not creating another dependency (that might go away).
Anyhow, please do test on 3.12. I think you'll find it breaks there, too.
from md2pptx.
It looks like Pillow at a high enough level could do. (9.5.0 for 3.12?) We already make it an optional prereq. Probably have to make it a mandatory one.
from md2pptx.
I was wrong. imghdr is apparently just picking up the filetype for a graphic. Will have to think about how to do that differently. (Pillow is used for something else and can remain optional.)
from md2pptx.
This Stack Overflow article poses the idea that one could use the file extension:
filename.lower().endswith(('.png', '.jpg', '.jpeg', '.tiff', '.bmp', '.gif'))
I'm not wowed by this but maybe imghdr was doing little more than that.
from md2pptx.
Built not using imghdr but testing filename extensions. Please try the latest md2pptx file out. On 3.12 if you like. Or maybe 3.13. Let me know how it goes. I want to publish a release that says it supports 3.12.
from md2pptx.
My initial tests with 3.12.2 and 3.13.0a5 show md2pptx continuing to work. (Installed both via pyenv and installed python-pptx into each environment.)
Thanks to your opening this issue @Mukei I now know how to test with newer versions. That should help keep this (and mdpre) current. mdpre is part of my make-driven presentation build toolchain and it worked fine with 3.12 and 3.13.
from md2pptx.
Fixed and shipped in v4.4.
Closing. Please reopen if you don't consider it fixed.
from md2pptx.
Related Issues (20)
- There's been an error:UnicodeEncodeError HOT 11
- how to integrate by code HOT 3
- Is there any tutorial on converting ppt to markdown language, besides examples? HOT 2
- Is it possible to read the image in an adjustable manner? HOT 15
- How to customize the background image of each ppt page? HOT 10
- Move docs to their own subfolder
- Add examples of `contentSplit` and `contentSplitDirection` HOT 1
- Make a card an object HOT 4
- Make graphics in cards clickable HOT 2
- Support video and audio in cards HOT 2
- Enhancement: Provide slide safe area for titles and contents with specific margins HOT 10
- In cards limit media dimensions to those of the card HOT 1
- how to use it HOT 2
- Python comment lines in code blocks are handled improperly HOT 2
- Allow change of font size in a text run HOT 2
- Make Text Parsing More Robust HOT 3
- Allow a slide to be hidden HOT 2
- Latin character í (Latin small letter i with acute) is displayed with errors HOT 8
- Error: Slide Object has no slideInfo attribute HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md2pptx.