Download images from an external source iOS - objective-c

Is it possible to download images from a web server and save them in such a way that
[UIImage imageNamed:#"filename"]
would still work for filename.png and filename#2x.png just as if they had been sent along in the application package all along?

Adding my comment as an answer. You can try to send the scale based on retina/non-retina and then download a single image based on that. You dont need to worry about combining two images and downloading since a device can be either retina or non-retina only. You dont need both images at the same time.

You can download the images based on retina/non-retina of the device itself. No need to keep both in the same device.

As you are considering downloading both images, so bandwidth per se is not of concern, why not combine the two images into a multi-resolution TIFF and download that from the web server? If you do that and load the image from the file the correct resolution will be picked automatically.

Related

MacOS/Safari double extensions when using ImageResizer

We are converting large PNG images to JPEG using ImageResizer (https://imageresizing.net/). It's works great with ?format=jpg and they are delivered with the correct content type and all.
When downloading these images they are named image.jpg in all browsers except Safari. Here it asks the user if they want to go with .jpg or with .png. It also saves the images as image.png.jpg which is confusing for some users.
I read something about Content-Disposition header, but I think that's for direct download, not for right click and choosing Save as. I also don't know if it would be possible to add it without creating some kind of middle layer and probably lose performance.
Ideas? Thanks <3
I don't think there is a solution to this, as it is in the browser's control.

how do I remove write-protection from a Google Cloud Platform Compute Engine image?

I've opened my first Compute Engine VM (Linux in this case), added what I need (applications for instance), and created an Image from it.
I can then use that Image to spin up other VMs.
However the files I've put in the image then seem to be write-protected, and I can't alter them. How do I remove this write-protection?
If that's not possible, how can I change the image?
I don't think there is a direct way to access the custom image and modifying it without connecting to the VM-Instance. As per my understanding you can attach the custom image to the new VM-instance, modify that image further as per your requirements and then make another image and assign it another version number . Please see the link-1 for Setting image versions in an image family.

Upload same image in different sizes - Dropzonejs

There is any possibility to upload a file with different sizes in DropzoneJs?
I'm using vue-dropzone which is made with dropzonejs and i have to upload the same file with different sizing for srcset.
Example:
I want to upload the file test.png which is 1000x500 px. There is any possibility to upload it at the same time in original resolution and also in 500x250px?
Image resizing in the browser has been a seat-of-the pants experience for a long time. Web assemblies are the way of the future for processing-intensive tasks in web apps. I came across this project the other day. It looks fantastic and I really can't wait to strip out our home-baked image resizing with canvas and replace it with this.
The usual reason for doing this is to avoid large uploads. It's a little bit weird to want to resize in the browser then upload the original. You might be better resizing on the server. You'll save bandwidth and the server libraries will be more mature than what's available on the client.
Along with the original image object you can add one more your custom resized image to the array of images by using resize config of dropzone. You can do the above on drop event or adddedFile event of dropzone.

Loading pictures to gallery

I need some advice. In my application people can upload images. I will store the images on a server. I want to make a photo gallery where you can see all uploaded images. Every user has a account. And it will download all uploaded images.
The point is that when you uploaded 1 image it has to download 1 image. But when you upload 10 or more the app will have to download all images and cache the images to your device.
What is the best way to download all images and keep the app running without getting stuck. Also what is the best way to cache all images.
If you want to create some photo gallery apps, check out this open source sample.
Created by Michael Waterfall, which includes photo gallery from images stored on server or locally.
You can modify the code as per your project requirements. And it is easy to handle the images.

Where are the PDF files in iPhone ? Can I load them in an app?

I want to make the user of the app I'm developing, able to load a PDF file from his device as if he was loading an image from the gallery.
Is it possible and if so, where are the PDF files ?
Thanks a lot for your advices
I think that isn't possible, see that: https://stackoverflow.com/a/7778719/1451392
No, it's not possible. Every application has its own memory space (.app folder) which it can access (plus some special folders like the image gallery).
You can access your share of memory via [NSUserDefaults sharedDefaults].