Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#3160 closed change (fixed)

Allow users to download images to their local photo storage

Reported by: sven Assignee:
Priority: P3 Milestone: Adblock-Browser-for-iOS-1.2.0
Module: Adblock-Browser-for-iOS Keywords: salsita
Cc: jand, pavelz, mario Blocked By:
Blocking: Platform: Adblock Browser for iOS
Ready: yes Confidential: no
Tester: Shikitita Verified working: yes
Review URL(s):

Description (last modified by mario)

Background

There is no option to download images to your local image storage as of now.

There are two use cases where image downloads should be implemented:

  1. Images, that are embedded into websites. (e.g. http://google.com/ - The Google logo)
  2. Images, that are displayed separately (e.g. https://eyeo.com/images/media/abp_icon.jpg)

What to change

For both use cases as described above implement the following changes:

  • Add a new item labelled "Save image" to the context menu that is displayed when a user taps on an image element, as long as the element being pressed is of the supported image types. Implement as in the layout in attachment: "adblock browser iOS 57 press and hold menu 2.png".
    • Display the content of the "alt=" attribute within the <img> tag as the title of the context menu. If there is no alt attribute, display the image name as the title instead.
  • Download the selected file, store it into "Apple Photos" and close the context menu as soon as the user taps on "Save Image" within the context menu. Save the file with the exact file name as provided by the server.

Attachments (1)

adblock browser iOS 57 press and hold menu 2.png (251.8 KB) - added by sven 4 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 4 years ago by sven

  • Cc jand added
  • Description modified (diff)

comment:2 Changed 4 years ago by sven

  • Cc pavelz added

comment:4 Changed 4 years ago by mario

  • Keywords salsita added

comment:5 Changed 4 years ago by mario

@vojtab, Is there a mechanism in iOS in order to properly handle/open "known" file types by the corresponding app like proposed in the description? Please let us know if you need more information (e.g. list of file types to handle) in case this is not automatically handled by internal mechanisms.

comment:6 Changed 4 years ago by pavelz

Short answer is No. I wonder what was meant by the "default iOS apps" sentence, it is unfortunately misleading. As already discussed with Sven: there is no automatic handling. It's up to our code to detect the content type and handle it accordingly. Only images are certainly recognizable. Videos are not 100% certain but still quite safe by response header MIME type. Both mentioned cases have one thing in common: it is storeable right away in an iOS-reserved place. Any other file type can only be stored right in the app and a download manager must be implemented, allowing for listing the downloaded files and offering a selection of actions on it. There is no "Save to" on iOS. A generic file can only be piped to another app (not "stored") or to a web service (ie. cloud storage)

In terms of an implementation effort, image alone is easiest by far, followed by videos - no download mgr needed but requires analysing the response header to detect the content type and file name. Generic file type is the most effort, requires new UI and file storage mgmt.

I believe that the preliminary conclusion was to implement images as the most requested feature, and the rest of types with lesser priority. Making it one common ticket is somewhat unfortunate.

comment:7 Changed 4 years ago by mario

  • Cc mario added
  • Description modified (diff)
  • Summary changed from As a user i want to save images and known files with known file formats to Allow users to download images to their local photo storage

I have revised the description to only cover image downloads now.

comment:8 Changed 4 years ago by mario

I've also tried to cover two other use-cases, but other iOS Browsers seem to ignore them:

  • Forced image downloads ("Content-Disposition: attachment" and the like) seem to be ignored and don't trigger a download.
  • Text links to images seem like they also don't trigger the "Save Image" long-press context menu item.

As Safari behaves like this (and as both use-cases would lead to the image URL where the user can subsequently download the image manually), I've decided to ignore them as well. Do you agree?

comment:9 Changed 4 years ago by mario

  • Description modified (diff)

comment:10 Changed 4 years ago by mario

  • Description modified (diff)

comment:11 Changed 4 years ago by mario

  • Description modified (diff)

Added the passage about saving the file with the exact filename as provided by the server. Please let me know if there is any possibility, that the server might not return a proper file name, that I'm not aware of. In that case, I'll extend that addition.

comment:12 Changed 4 years ago by mario

  • Priority changed from Unknown to P3
  • Ready set

comment:13 Changed 4 years ago by pavelz

  • Resolution set to fixed
  • Status changed from new to closed

comment:14 Changed 4 years ago by mario

  • Milestone set to Adblock-Browser-for-iOS-next

comment:15 Changed 4 years ago by Shikitita

  • Tester changed from Unknown to Shikitita
  • Verified working set
Note: See TracTickets for help on using tickets.