Closed gutiago closed 2 years ago
I had the same issue. I was using this in conjunction with GPUImage, and I found out that I had to pre-configure the camera's frame/resolutions size for the iPhone X, or else the filter view would stretch the image or video.
I am facing the same issue with iPhone X. I have used SCFilterImageView. @gutiago @HackShitUp let me know if you have found any solution for this.
@gutiago @hardik99 if you're using the GPUImage dependency, I resized the camera target size to ensure that the content of the image or video is equal to the filter view
I've ended up changing the size of the view displaying the video content. I've put it in a 16:9 resolution and the background color was set to black. I tried a lot of things, even change de content mode of the internal classes, but without success.
@gutiago so it was resolved? I think it has less to do with SCRecorder's contentMode but the content of the image or video asset itself
Yes, I it worked! I mean, I think it's a good approach to solve this situation. If your app really needs to display the video on the entire screen on the X, I have no idea how to help. And also, if I'm not wrong, constraining the view to Safe Area, reduced the sensation of a stretch image.
@HackShitUp I am also facing same issue in iPhone X . My app needs to display video in full screen . Did you found any solution for that issue? If yes than Can you please share code with me?
Hi @gutiago I am also facing same issue in iPhone X only. i am also trying to do so same thing which you have done to fix that issue. I am adding filter switcher view as subview in my own view programmatically . And tried to change ratio of that filter switcher view but there is no difference i can see. Can you please help with how did you set aspect ratio 16:9?
Thanks
For anyone still needing this, I managed to fixed the issue by cropping the image to the required rect in SCImageView.m - scaleAndResizeCIImage:forRect:
verticalScale = horizontalScale;
}
- return [image imageByApplyingTransform:CGAffineTransformMakeScale(horizontalScale, verticalScale)];
+ image = [image imageByApplyingTransform:CGAffineTransformMakeScale(horizontalScale, verticalScale)];
+ rect.origin.x = CGRectGetMidX(image.extent) - CGRectGetMidX(rect);
+ rect.origin.y = CGRectGetMidY(image.extent) - CGRectGetMidY(rect);
+ return [image imageByCroppingToRect:rect];
}
- (void)drawRect:(CGRect)rect {
For anyone still needing this, I managed to fixed the issue by cropping the image to the required rect in SCImageView.m - scaleAndResizeCIImage:forRect:
verticalScale = horizontalScale; } - return [image imageByApplyingTransform:CGAffineTransformMakeScale(horizontalScale, verticalScale)]; + image = [image imageByApplyingTransform:CGAffineTransformMakeScale(horizontalScale, verticalScale)]; + rect.origin.x = CGRectGetMidX(image.extent) - CGRectGetMidX(rect); + rect.origin.y = CGRectGetMidY(image.extent) - CGRectGetMidY(rect); + return [image imageByCroppingToRect:rect]; } - (void)drawRect:(CGRect)rect {
still it is stretching in the perivew
So, I'm using SCSwipeableFilterView on my project, it works well on all devices, when using SCSwipeableFilterView. But, when I run on a iPhone X, my video gets stretched. For some reason, it does not respect the content mode applied. Does anyone know how to solve it?