Skip to content
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

Fixes issue #75 #110

Merged
merged 6 commits into from
Dec 23, 2023
Merged

Fixes issue #75 #110

merged 6 commits into from
Dec 23, 2023

Conversation

EliAgne
Copy link
Contributor

@EliAgne EliAgne commented Dec 20, 2023

Copied dimension classes over since they are only used for holding the width and height.

Replaced the ImageUtils class for spreadsheets and reads the file contents to determine size versus using javax.imageio classes.

Copied dimension classes over since they are only used for holding the width and height.

Replaced the ImageUtils class for spreadsheets and reads the file contents to determine size versus using javax.imageio classes.
@centic9
Copy link
Owner

centic9 commented Dec 20, 2023

Thanks for the work!

@EliAgne
Copy link
Contributor Author

EliAgne commented Dec 21, 2023

Thanks for heading the port to android. Yeah everything was the same from ImageUtils except I changed the getImageDimension method to not make any calls to the javax.imageio classes. I thought it would be a safe-enough change considering that getImageDimension seems to only be called in ImageUtils. But yeah that's a good point, it could cause some unforeseen issues.

Yeah it looks like there would need to be some abstraction of the Apache POI's image I/O to allow other JVM systems (that don't have javax) to register their own Image I/O provider. Then a system could implement the abstract methods and register it as the provider, or something like that. But abstracting that, then reimplementing that with android's graphics seems like a lot of work and I'm not sure how feasible it would be. That might be a difficult merge request to get through.

Good idea, I'll look to add the scenarios for the other supported file formats.

@centic9
Copy link
Owner

centic9 commented Dec 21, 2023

Is there a way to provide the replacement-code via classes in the javax.imageio package and relocate it similar to the awt classes so that Apache POI can stay unchanged?

@EliAgne
Copy link
Contributor Author

EliAgne commented Dec 21, 2023

Good point, I think that makes the most sense. I'll look into that. I suppose there should really be no harm going that route considering the imageIO library doesn't work now anyways. Although it will take some time since I don't think the shadow classes have access to the android SDK.

I'll move this request to a draft in the mean time.

@EliAgne EliAgne marked this pull request as draft December 21, 2023 18:52
@EliAgne EliAgne marked this pull request as ready for review December 22, 2023 16:56
@EliAgne
Copy link
Contributor Author

EliAgne commented Dec 22, 2023

I added only necessary shadow classes for java.awt and java.imageio and added some compatibility classes for reading image files. The functionality is only focused on fixing the resizing issue, but would still have some functionality in other areas that uses those same methods. Or at least maybe a good starting point if other compatibility is desired.

@centic9
Copy link
Owner

centic9 commented Dec 22, 2023

Thanks for the work, I'll try to take a look in the coming days.

@centic9 centic9 merged commit b07739a into centic9:master Dec 23, 2023
2 checks passed
@centic9
Copy link
Owner

centic9 commented Dec 23, 2023

Thanks a lot for the changed approach, works great when testing the sample-app!

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