-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
A single white line is added to images which were imported from external cameras on iOS #3205
Comments
I just found another user's post with the white line on the image, and verified that it was also an image imported from an external camera to iOS, and posted on the iOS Bsky app. https://bsky.app/profile/repepo.bsky.social/post/3knmf5rc5wb2f |
I did some work here #5464 that might fix this. Let's see. I could never repro the problem in the first place so not sure if this will work. |
@haileyok I haven't tested because I don't want to go through building everything just yet. But I think the issue occurs because the function that uses UIKit for iOS (scaleImage) in
The size parameter in The resolution of the image that @adamatic-me uploaded is Many common aspect ratios, such as When A way this could be fixed in the current implementation is to round the values to integers:
This will eliminate fractional pixels. Then use A corrected
Of course, you are ripping that library out shortly to move to Expo. I was looking into how Expo handles this on iOS when I first saw your PR. Unfortunately, this code can run into the same bug and the same fix applies:
The information and code above are based on what is in Expo SDK 51 (latest stable). The upcoming version of Expo, Next (unversioned), will implement a new API for image manipulation, you can see the resizing function here. This moves the code away from Unfortunately the issue exists here too. Without rounding,
Full disclosure: I have never built code for iOS (just bought my first iPhone last week so I could learn), so I may be wrong about some of this. My recent deep dive into the docs and code was because I wanted to understand how the image downscaling was being implemented after I noticed inconsistencies across platforms, and then saw in your PR that the library was changing. While the Expo Next iOS transform would be fine with the fix I included above, it would be nice if they implemented high quality interpolation (
If I have time to get this into an Expo PR I will, but I would want to get setup to build for iOS to test these fixes before I do that, and I'm in the middle of audit season at $dayjob. In lieu of that, tagging @lukmccall so he can at least see this and consider it for a future improvement. FWIW, the web function for image resizing used by Expo Next (canvas with Hermite filter) is great for quality output but could have similar issues under specific conditions. The Android implementation could use the same fixes – I originally encountered the 1px white line bug last year on Android, as |
Describe the bug
A single white line is added to only some images that I upload on iOS.
To Reproduce
Steps to reproduce the behavior to show the white line on the bottom:
Please note that the same exact image file uploaded via desktop does not have the white line.
Expected behavior
The image should not have an additional white line added to the border when uploading from iOS.
Details
Additional context
While this seems like a niche bug, a lot of photographers use the fancy camera -> iOS -> social post workflow. It is disheartening to put so much work into an image just to have Bsky alter it after posting.
The cause of the white line appears to be related to the source of the image. The only images I have seen this happen to so far, were imported to my iPhone from a different camera. However, this only happens when posted from iOS to Bsky. The line is not added when sharing from iOS to Gmail to desktop post, for example.
Example of post with the additional line from iOS : https://bsky.app/profile/adamatic.bsky.social/post/3knm5mmdksk2m
Example of post with no additional line, with same exact image file sent from iPhone via email to desktop, and then posted to Bsky webapp: https://bsky.app/profile/adamatic.bsky.social/post/3knmalz4nm22g
Additional example of a post, with a white line, also imported from an external camera to iOS: https://bsky.app/profile/adamatic.bsky.social/post/3knbm3deaj22r Please note that here, the line is on the right edge of the posted image. This is due to the fact that the image was rotated to portrait. So, the line seems to appear on the original (sensor) bottom edge of the image.
The text was updated successfully, but these errors were encountered: