Skip to content

Updated steganography.py #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ananyasingh2002
Copy link

I changed the code to make it work with different image types, not just JPEG. Now, the code checks what type of image you're using and saves it in the same format. This way, it won't give you errors if you use a different kind of image.

@Ananyasingh2002
Copy link
Author

Please review the changes.

Copy link
Owner

@kelvins kelvins left a comment

Choose a reason for hiding this comment

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

Hi @Ananyasingh2002, thanks for the contrib, but why should we override the image format the user wants to save? In my opinion it would be better to raise an exception related to unsupported file formats than automatically changing the file format to something else.

Also, I tried it locally and it didn't seem to work. Here's a minimal example if you want to try:

from PIL import Image
image = Image.open("res/image1.jpg")
image.save("output1.png", format="JPEG")

This ☝️ is saving the image as PNG not JPEG (using Pillow 10.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants