Closed StfBauer closed 2 years ago
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Adding a similar issue.
@anoopt Thanx. This case happens even with the out of the box web parts. None of those load SVG images + other images is CSS wise broken.
Hi @StfBauer -
@frags51 Thank you for the update.
1.) Happy to get the support ASAP. Thank you for your effort. 2020 where everything is all about SVG this is not a great user story to have forgotten about this support. Will then Level 2 Cards also be able to load SVG images?
2.) Then the documentation and implementation are wrong since those cards do not use a 1:1 ratio at all. On Desktop the images are 164x180, which translates on Mobile to a 507px x by 516px. While on other screen resolutions it also has 186px by 180px - Desktop small screen. Either the implementation or the documentation is wrong.
@StfBauer
1.) SVG height and width properties can be battled using aspect-ratio or object-fit. The way the cards are currently implemented has some CSS issues, which exactly cause troubles with the distortion. There are some positions: absolute definitions, which are not required.
2.) Not sure how you tested it but I think your testing is wrong. Took out the measurements from a 1:1 screenshot in an iPhone 13 Pro. Which is also a 1:1 representation of the design. So scaling not downsampling. My guess is you tested it in the browser teams app on Microsoft Edge or Chrome. Those browser engines are not available on an iPhone. You only are allowed to use the WebKit engine, not the chromium.
In order to test it properly, you have to use real devices. So while you can simulate how the dimensions of a browser work on an iPhone with the developer tool, you can not test what the actually rendering looks like. In there you would only see how Edge/Chrome renders it, which is not the engine picked up on iOS.
To add to Stefan's point on testing on mobile devices, if helpful, we can use the spfx-fast-serve
's ngrok plugin to see results instantly on a mobile device.
@StfBauer My bad - I was talking about different units (dp) and not pixels. I have tested and pasted the above screenshot from Viva Connections app on an iOS device. However, if the image dimensions are more than 400 pixels, SharePoint compresses them to a lower resolution (<= 400 pixels in the highest dimension). Due to an issue in this process, we see a slightly aspect-ratio wise distorted image as you pasted in your screenshot:
Please try this case out after reducing the image resolution to < 400 pixels as a workaround until we fix the compression logic. Let me know if it works.
Thanks!
That's fine for now but it's a bit strange that in any case mobile and desktop "should" have a 1:1 ratio but do not have because of the current implementation.
So for resizing it doesn't have to be super smart because you know the target resolution, you know that the image is portrait or landscape and this is enough information to reduce the size of the file to match right in the frame. Pretty common web development workflow and I wouldn't resize it to be squared when you have to leave it portrait or landscape and make it object-fit.
Also, keep in mind that maybe picture look add then a 300x300 pixel is rendered at 216px/inch instead of 72px/inch
Another thing I just recognised is that the drop shadow gets dropped on the image. So you only have it on the left part, which also kinda looks odd. Again here is a screenshot of a real device.
@StfBauer
That's fine for now but it's a bit strange that in any case mobile and desktop "should" have a 1:1 ratio but do not have because of the current implementation.
Thanks for this feedback - we will have a look at the 1:1 (we might need to correct our docs). What I was trying to say is that for now please use an image with dimensions lower than 400px (no need to enforce the 1:1 aspect ratio), due to an issue with image compresion on our side (and not with resize/object-fit). From your latest screenshot, it appears that this is working for you (and you no longer see a distorted image as mentioned in the screenshot in issue description).
Another thing I just recognised is that the drop shadow gets dropped on the image. So you only have it on the left part, which also kinda looks odd. Again here is a screenshot of a real device.
Could you please elaborate more on this - or maybe please create a separate issue for this.
Thanks!
hey @StfBauer, feel free to elaborate more here on what @frags51 mentioned or close this issue and open a new one. Thanks
Thanks, @lucabandMSFT, @frags51 - I found out what it is. It is a "design quirks" aka optical illusion. Not sure how to say it better.
Example 1:
White (left) against the box-shadow makes a hard contrast therefore the box-shadow looks darker than it is. Solid color - The box-shadow looks lighter and on normal view, it looks like there is a cut off 1 px so the image appears to be smaller than the rest of the card.
Example 2:
Box-shadow against white it looks like it is there. Box-shadow against anything else or in this case SharePoint Teal, the box-shadow disappears. Since there is no hard border between content, e.g. a 1px white line. The box-shadow - looks like it vanished and come back again.
I checked it in Photoshop and the color (#d7d7d7) that the box-shadow show is the same across the whole length.
Also could just be me who recognises this. So all is good for now.
thanks @StfBauer for reaching out. I'm going to close this one then.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
other (enter in the "Additional environment details" area below)
Developer environment
macOS
What browser(s) / client(s) have you tested
Additional environment details
Microsoft Teams Client![IMG_9C378E197A93-1](https://user-images.githubusercontent.com/5503835/157042638-6636da7e-6270-42a0-9f38-1a3d41239d3f.jpeg)
Describe the bug / error
Viva Connections Dashboard on a Desktop Computer looks like this:![image](https://user-images.githubusercontent.com/5503835/157042788-448f30b9-c7c0-49b7-8033-a74607189ad0.png)
All images on this Dashboard are SVG Graphics and load perfectly fine. In MS Teams on a mobile device they look like this:![image](https://user-images.githubusercontent.com/5503835/157043025-41e098b0-1226-4f2d-be57-dab6c5111715.png)
The SVG graphics fail to load, while the image that is loading has a huge distortion in Teams. It seems like the desktop styling does not apply in Teams.
Steps to reproduce
Create a card using Adaptive Card designer or SPFx
Add SVG graphic as an image
Create a card using Adaptive Card Designer or SPFx
Add image that is larger then the image placeholder - Resize on Desktop works fine but not in Teams client.
Expected behavior
Images should load correctly as well as size correctly.