How to Display .svg image in XCode 6.3.1 - macos

Good Day.
I am making an extension for mac. The RestAPI i am using is providing image url that has .svg format images. I tried loading .svg images but nothing appears. I know mac supports png images and there is a tedious way to render .svg image on mac. Is there any way i can convert .svg to .png upon download using swift?

As far as I know there's no OSX or iOS native support for SVG files. A quick search of GitHub using the search string "Mac SVG" found several libraries that will display SVG files. I suggest you use one of those.

Related

Whether to download a zip of png images and maintain locally (or) download each png image on demand

Our Xamarin forms app supports both Android and IOS. This app uses a lot of png images on each and every screen.
We are looking for a better approach to deal with it. Whether to download a zip of png images and maintain them locally (or) download each png image on demand and cache it. It's ok if the application takes bit more time at the time of login. Could you please suggest.

Showing Images via HTML String on a Xamarin.Forms WebView

So, I wanted to display html pages on a WebView in my Xamarin.Forms app. The html pages contain numerous images which are locally stored (PersonalFolder on Android & iOS and WindowsStorage LocalFolder on UWP).
For Android it works very well (not tested on iOS yet) and I can display the images. However it doesn't seem to be working on UWP. After some research on multiple forums I concluded that the only way to display images on a WebView via html string is to convert the images to Base64 string.
And this actually works, but the process of reading the image from the disk and converting to Base64 takes a while than I would expect (even on a high-end PC).
The other option I had is to save the Base64 string in to my SQLite db, but here my concern is the db will grow drastically.
My images are dynamically downloaded from the web and can not be included in "Assets" folder as part of the project.
Can anyone help me understand, if these are the only ways? Any better alternatives? I wish I could display images on UWP just like I could on Android.

How should image EXIF information be handled?

I noticed that all my browsers:
Mozilla Firefox
Google Chrome
Microsoft Edge
Internet Explorer
seem to ignore image EXIF orientation data.
But other programs are orienting the images when they are opened/displayed:
Google Mail
MS Paint
IrfanView
Windows Explorer
We have a webpage on which users can upload images. I am asking, because users are complaining that the uploaded images look diferent/rotated than when opened on their local device using an image viewer. It seems to become an icreasing problem as more and more users are using smartphones and cameras to upload images directly without using any image editing software.
Here you can find some example images that have EXIF data in their header: https://github.com/recurser/exif-orientation-examples
Question: Since the browsers are ignoring the EXIF orienting should one auto-apply them on the uploaded images and then strip them from the header? Why are browsers ignoring EXIF information? What to do?

Why is iconutil generating chopped up images on retina display?

I have an .iconset which can be found here. Building a binary with Xcode results in an icon that looks like
Generating a .icns file directly using iconutil results in the same thing. Everything but the full resolution asset look weirdly chopped up on retina screens, but displays fine on non-retina screens. Converting the generated .icns back to an .iconset gives me the chopped up assets instead of the original assets.
Anyone have any idea as to what might be going wrong here?
I figured it out, though I'm not exactly sure what caused it.
I generated the app icon using Gimp. I believe when I first generated the icon I created a 1024x1024 icon and then scaled it down using Preview. I just regenerated all of the assets by scaling and exporting all through Gimp. Now the assets look fine. Presumably some information was lost in Preview's scaling.
I believe you need to put them in an Asset Catalog to get all the resolutions to show up correctly. If you don't migrate them into one you can manually edit your applications .plist file, although there shouldn't be any compelling reason you would need to go that route.
Reference: Mac Developer Library: Asset Catalog Help
Select Targets > Your App > General > App Icons

Creating a PDF viewer for Silverlight, without external plugin

I'm trying to implement / use PDF viewer for Silverlight 5 in the browser.
Googling the subject produced some interesting results but most of them are based
on having an external PDF viewer such as Acrobat. I want to achieve this without having the user installing software.
I've understood that it can be done by converting the PDF to PNG and displaying the PNG file.
I'm trying to show a png file. I've succeeded using the simple tool
I'm using MVVM and is new to Silverlight.
Thanks,
Guy

Resources