FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

_imaging module cleanup by homm · Pull Request #8389 · python-pillow/Pillow · GitHub

_imaging module cleanup - #8389

Closed
homm wants to merge 23 commits into
mainfrom
imaging-cleanup
Closed

_imaging module cleanup#8389
homm wants to merge 23 commits into
mainfrom
imaging-cleanup

Conversation

homm commented Sep 18, 2024
edited
Loading

Copy link
Copy Markdown
Member

Includes some useful changers from #8340.

Improvements

  • Move some useful macro such as MAX and MIN to ImagingUtils.h 517f16b
  • ImPlatform.h is renamed to ImagingPlatform.h d73e8c2
  • All #undef *INT* moved to Jpeg.h 8909052
  • Simplify #define *INT* by requiring stdint.h (C99) 92bf691
  • #include <Python.h> once in Imaging.h 84f0261
  • #include <math.h> in ImagingPlatform.h fbd4c98
  • Include all global libs with <*.h> instead of "*.h" 108602b
  • Removed add-imaging-libs option (is not documented, not sure why we need it) c3172e8
  • Use native functions instead of PyImaging_CheckBuffer and PyImaging_GetBuffer e972962
  • Use Py_RETURN_NONE macro when possible f58cd7d
  • Remove unused HAVE_LIBMPEG ffa0230
  • Move new_block method to _imaging and fix some functions arguments type e7bce42
  • Remove unused core.convert function e7bce42
  • Simplify Imaging_Type checking in _convert b89f791
  • Use PyErr_Format instead of sprintf, use native PyErr_Clear function, remove extra PyExc_TypeError after PySequence_Fast, remove unused Except.c file 05a67d1

Comment thread src/libImaging/Jpeg.h Outdated
Comment thread src/libImaging/Draw.c
#include "Imaging.h"

#include <math.h>
#include <stdint.h>

homm Sep 18, 2024
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

One of the reason I think we can rely on C99 is stdint.h was included here unconditionally.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The default standard used by GCC on CentOS 7 was gnu90, which is not C99, but does support stdint.h. CentOS 7 is no longer supported though. The conclusion from this discussion (#6516) was essentially that if it compiles in all of the test environments, it's okay to use.

#endif
#endif

#if defined(_WIN32) || defined(__CYGWIN__) /* WIN */

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I will examine this and return if needed:
#5807

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Sorry, I'm not completely clear on your meaning - reconsidering this change is a to-do item for yourself before this PR is ready for merge?

Comment thread src/_imagingcms.c Outdated
homm force-pushed the imaging-cleanup branch from 9ec3c03 to 5e07d85 Compare October 7, 2024 15:10
Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>

Copy link
Copy Markdown
Member

Just tracking the progress on this.

ImPlatform.h is renamed to ImagingPlatform.h d73e8c2

I've created #9377

Removed add-imaging-libs option (is not documented, not sure why we need it) c3172e8

Merged in #9378

Use Py_RETURN_NONE macro when possible f58cd7d

Merged in #8717

Remove unused HAVE_LIBMPEG ffa0230

Merged in #8717

Use PyErr_Format instead of sprintf, use native PyErr_Clear function, remove extra PyExc_TypeError after PySequence_Fast, remove unused Except.c file 05a67d1

#8717 and #9021 cover parts of this.

Copy link
Copy Markdown
Member

Closing.

Many of the changes from this have been merged. If there's anything left here that you think should still be included, please leave a comment explaining why.

radarhere closed this Aug 29, 2026
radarhere deleted the imaging-cleanup branch August 29, 2026 00:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL