GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Question: how does it work? · Issue #8 · Piasy/BigImageViewer

Question: how does it work? #8

New issue
Copy link
New issue
Copy link
Closed
Closed
Question: how does it work?#8
Copy link
Labels
question

Description

@AndroidDeveloperLB
AndroidDeveloperLB
opened on Nov 16, 2016
Issue body actions

Does it do downsampling again and again on the same file, or does it load all into JNI, and then just pick the pixels it needs ?

Or maybe it has the option to choose from them ? I mean, it would be a waste to downsample all the time, when you can have it all in the RAM (without being afraid of OOM) ...

Activity

  1. Piasy commented on Nov 16, 2016

    @Piasy
    Piasy
    on Nov 16, 2016
    Owner
    More actions

    That's implementation detail of SSIV, briefly speaking:

    It does a downsampling when load the image fully into screen (as a Bitmap, so it's in java heap), that downsampling is optional too, if the image is very small, no downsampling happens, then when user zoom the image, only several regions of the image is decoded (also as Bitmap, java heap).

    For more detail, you can refer to https://github.com/davemorrissey/subsampling-scale-image-view .

  2. AndroidDeveloperLB commented on Nov 16, 2016

    @AndroidDeveloperLB
    AndroidDeveloperLB
    on Nov 16, 2016
    Author
    More actions

    I see. Can you also add the JNI solution?
    I think it should be better in terms of performance and maybe even heap memory usage.
    You could even downsample in your own way. As I remember, the downsampling of Android is only of power of 2, and it sometimes has some aliasing in it.

    In the past, I created a library that shows how to mess around with bitmaps, but sadly it doesn't do the decoding in JNI: https://github.com/AndroidDeveloperLB/AndroidJniBitmapOperations
    However, I remember I saw a library that does the decoding in JNI too, yet it wasn't seem to be easy to use.

  3. Piasy commented on Nov 16, 2016

    @Piasy
    Piasy
    on Nov 16, 2016
    Owner
    More actions

    Image loading and cacheing, that's the responsibility of image loading library, e.g. Fresco, Glide, Picasso, and image displaying, including downsampling, pan and zoom, animation, etc, is the responsibility of image displaying library, e.g. SSIV.

    This library focus on bridging them together, although currently only image loading library is configurable, but if there are other brilliant image displaying libraries, make it configurable is very easy.

  4. AndroidDeveloperLB commented on Nov 16, 2016

    @AndroidDeveloperLB
    AndroidDeveloperLB
    on Nov 16, 2016
    Author
    More actions

    I'm not complaining. I just suggest this as another option, because I think a single decoding (even if it's a bit long) might be better than multiple ones, as long as your device has enough RAM.
    If you take, for example, a 40MP image, it takes around 40*4 = 160MB of RAM. This is a lot for heap memory, but it's fine for RAM itself, because most devices out there have at least 1GB of RAM.

  5. Piasy commented on Nov 16, 2016

    @Piasy
    Piasy
    on Nov 16, 2016
    Owner
    More actions

    Yep, I understand. But I really think that's another image displaying library. Besides, I don't have enough knowledge and time to do such thing, currently.

    If you have a good solution, I can modify this library to use your image viewer as an option :)

  6. AndroidDeveloperLB commented on Nov 16, 2016

    @AndroidDeveloperLB
    AndroidDeveloperLB
    on Nov 16, 2016
    Author
    More actions

    Sadly the more I read about it, the more complex I saw of how to decode images in JNI.

  7. Piasy
    added
    question
    on Nov 17, 2016
  8. Piasy commented on Nov 18, 2016

    @Piasy
    Piasy
    on Nov 18, 2016
    Owner
    More actions

    I'm going to close this issue, if you have other questions, please feel free to reopen it :)

  9. Piasy
    closed this as completedon Nov 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.