ankidroid / Anki-Android

AnkiDroid: Anki flashcards on Android. Your secret trick to achieve superhuman information retention.
GNU General Public License v3.0
8.64k stars 2.23k forks source link

Picture fit to screen #1020

Closed hssm closed 9 years ago

hssm commented 9 years ago

Originally reported on Google Code with ID 117

First of all thank you so much for this great program. I have always found it easy to
learn but difficult to remember what I have learned. The idea of being able to recall
the necessary stuff in breaks at work or on the move has really turned my life around.

What steps will reproduce the problem?
1. A card with any picture file (jpg)
2.
3.

What is the expected output? What do you see instead?

Like on AnkiMini I hoped that the picture would be scaled to fit the screen and one
could then zoom if necessary. I know this is not a feature of the desktop version but
on a portable device it would be really useful.

What version of the product are you using? On what operating system?

I am using the latest version on a HTC Desire with android 2.1.

PS: I would be happy to pay for the features I would like to have in the product.

Please provide any additional information below.

Reported by andershildebrandt on 2010-06-23 05:45:20

hssm commented 9 years ago
Someone suggests to do it with JavaScript:
http://groups.google.com/group/android-developers/browse_thread/thread/6a5e00ab3b27aab5

Reported by nicolas.raoul on 2010-06-23 06:10:58

hssm commented 9 years ago
I asked here: http://stackoverflow.com/questions/3099344

Reported by nicolas.raoul on 2010-06-23 06:37:00

hssm commented 9 years ago

Reported by edu.zasu on 2010-08-30 14:56:29

hssm commented 9 years ago
Issue 197 has been merged into this issue.

Reported by nicolas.raoul on 2010-09-03 03:13:50

hssm commented 9 years ago
The question I asked at stackoverflow.com got me the "Tumbleweed" award :-/

Reported by nicolas.raoul on 2010-09-03 03:17:12

hssm commented 9 years ago

Reported by edu.zasu on 2010-09-06 17:42:36

hssm commented 9 years ago
I have just commited to Github a first version of the solution that scales pictures
to fit the screen:
http://github.com/edu-zamora/Anki-Android/commit/75d72502e723ce86f8367246a70ac563dbf498c8

I also added zoom to the webview, so if the details of the image cannot be appreciated
after scaling it down, the user still can zoom in and increase the size of it.

This solution does not work for images linked from web, but I will open a new issue
for this.

That was tested it with my HTC Hero and my Nexus One and it works in both of them in
portrait (I did not try in landscape due to this issue: http://code.google.com/p/ankidroid/issues/detail?id=171).

If enough people want to test it, I will build a new apk that includes that solution
but if that is not the case I will wait a little more to include more improvements
in the next apk.

Let me know what you think, guys! ;D

Reported by edu.zasu on 2010-09-06 18:55:06

hssm commented 9 years ago
Great news Edu.  I like your idea to add the zoom in function.

I'm happy to test it, and would need the apk.  But I'm perfectly happy to wait until
you roll up this change with others in the next "planned" apk.  I'd say your time is
better spent doing features and fixes, and less time spent creating single-use apks
for me and others to test.

Reported by gravel.jdp on 2010-09-07 21:37:50

hssm commented 9 years ago
Edu's enhancement is included in the latest alpha (0.5alpha5), so you can try it right
now :-)

Reported by nicolas.raoul on 2010-09-08 02:00:30

hssm commented 9 years ago
Edu,

First of all, let me apologize for the delay in getting to test this.  I did finally
get to it, and have some feedback.

No crashes - either with images or when using this apk for other reviews.

No images that didn't scale.  I found that tif images were not display - although I
don't know if TIF's not working is a symptom of the feature, of Anki, or of Android
in general.  JPG, PNG, and GIF seemed to work properly.

Images were scaled in both portrait and landscape mode.

My main concern is that there were several images that appeared to be scaled too much
- meaning they were scaled to be too small, and there was unused space around the edges
of the image displayed (so it did not need to be scaled as much as it was).
I have a sample deck with ~20 cards - it's attached as a zip file along with a text
file that tells which images scaled well and which were scaled too small on my Motorola
Droid with 2.2 firmware.

The zoom works very well - with the scaling so small - some of my cards are barely
readable without the zoom.  Zoom worked every time I tried it.

A theory - is is possible that the scaling is being done for the width in portrait
mode, and height in landscape mode?  That might explain the sometimes very small pictures?
 or perhaps you can find some clues with the attached deck.

Again, sorry for delayed response.  Please don't take it to mean that I don't appreciate
the effort you and Nicolas and others put in, and that you have working on some features
of particular interest to me :)

Thanks,
Jeff

Reported by gravel.jdp on 2010-09-15 02:28:10


hssm commented 9 years ago
Hi, will it be possible to hide the zoom buttons or perhaps move them to the top of
the screen?  My screen shows the Q and A, so the answer is often obscured by the zoom
buttons and I have to wait a few seconds for them to disappear before seeing the full
answer.

It's a neat feature that probably helps people with photos quite a bit.  Thanks.

Reported by ottenlips on 2010-09-17 07:21:08

hssm commented 9 years ago
Edu,
I have now tried .5alpha8, and it is improved over .5alpha4 in terms of scaling - good
work.  In portrait mode, I found fewer images that were not using the full screen.
 However, for some reason, the results were not consistent:  I built the test deck
with images from two existing decks, and four random images from the web.  The images
from the "Countries, Capitals..." deck now work much better - with only 2 cards not
using the full screen.  However, cards built from the "Anatomy - Bones" deck all still
are too small, and leave significant unused screen space.

I do most of my reviewing in portrait mode, so I am benefiting from the improved scaling
in .5alpha8 (vs alpha4).  I don't normally use landscape mode, but I found that in
landscape, a significant % of the images are often cover by the "Show Answer" button
or off the bottom of the screen.  Scaling the images smaller would certainly fix that
problem, but would then lead to some very small images.  It would seem to make sense
to use more of the top three fixed areas to display the image.  To be clear - by the
top three areas I mean 1) Andoid status bar (default includes icons at left, and battery
level and time at the far right) 2) AnkiDroid deck name and status ("Image Test_2 (20
of 20 due); 3) AnkiDroid card status and timer ("20 0 0         timer").  I don't know
if these areas are considered off limits, but for anyone who reviews images in landscape
mode, there is very little vertical space in which to display the actual image.
In the Scale_Test.zip file posted above, the only two country map files that left alot
of unused screen space were Brunei and Christmas Island.
Thanks,
Jeff

Reported by gravel.jdp on 2010-09-19 15:55:08

hssm commented 9 years ago
Matthew, I already talked with some user about that and yes it can be done but we should
make the zoom controls custom. I also think that the top of the screen, between the
card counters and the timer, is the best place to put the controls. I have just created
an issue for this: Issue #224

Jeff, in order to save space at the top of the screen and review pictures better in
landscape you can use the full screen mode, that hides the status bar and the title
bar. Also, all the images are always rescaled if they are larger than the screen's
width, but they are never rescaled for its height value (because scrolling vertically
is quite usual and we don't want to make the images so small). Regarding the scaling
of that two images that you mention, I will take a look as soon as I have time.

Don't worry, I don't! Personally, I am very happy with how good our users are and we
cannot ask you more :)

Thanks!

Reported by edu.zasu on 2010-09-20 15:23:48

hssm commented 9 years ago
Jeff,

the images of Brunei, Christmas Island and the ones from "Anatomy - Bones" deck are
in fact not scaled by AnkiDroid. We only scale down the images in case that its width
is larger than the width of the screen but these images aren't larger than the width's
screen (we have to take into account the resolution for each screen).

You can see that using Anki Desktop and AnkiDroid at the same time, and seeing that
the images that on Anki Desktop are wider than the 'Show answer' button are the ones
scaled by us and the ones that have less width than the button are narrower on AnkiDroid.

I could scale up the images in order to fill all the available space but I thought
it was not a good idea because if an image is scaled up a lot it could lose quality,
and we cannot decide to scale up some images and don't scale up some others.

What do you think about that?

Reported by edu.zasu on 2010-09-20 17:01:49

hssm commented 9 years ago
Edu,

  >> the full screen mode .... hides the status bar and the title bar
I believe you are talking about these two settings:
   Menu -> Preferences -> Show notification bar
   Menu -> Preferences -> Show timer
With those two unchecked, on my phone, the default Android notification bar goes away;
 "Deck Title (x of y due)" is now the top row of the screen, and the second row is
the card counts "(20 0 0)" for the sample deck.  For a real "full screen", you might
want to consider options to remove those two rows as well.  For me, since I do most
of my reviewing portrait, an option to remove those two items would be relatively low
priority.  If there is a separate setting for "full screen", point me to it and I'll
test that out as well.

  >> the images of Brunei, Christmas Island and the ones from "Anatomy - Bones" deck
are in fact not scaled by AnkiDroid
I apologize for sending you on a wild goose chase.  I don't know if older versions
used to scale small pictures up, or if I was just dreaming, but your logic that image
quality goes down as small pictures are scaled up does seem to make sense.

Reported by gravel.jdp on 2010-09-23 03:04:44

hssm commented 9 years ago
Edu,
I do not know what feedback is currently being sought, but I for one am happy with
the current implementation (0.5.1 market version).  Images seem to be scaled to fit
the screen, and the zoom button appears easily so I can zoom in when needed.
I am neither the initiator nor the developer for this one, but I'd be OK with it being
called closed in 0.5.1.
Thanks

Reported by gravel.jdp on 2011-02-17 17:35:17

hssm commented 9 years ago
Hi I am the original raiser of this issue and I wanted to try it out but I can't get
any of my decks with pictures to work. That is the sound files I have in the cards
are working but the pictures don't show. I am using mainly .jpg's. The same decks work
on my Ipod Touch. I using version 0.5.1 on a Sony Ericsson X10 Mini Pro. Can anybody
help me with this and I will be happy to test the feature.

Reported by andershildebrandt on 2011-03-10 20:49:13

hssm commented 9 years ago
Could you please try again with the latest beta?
http://code.google.com/p/ankidroid/downloads/list
Thanks for your feedback!

Reported by nicolas.raoul on 2011-03-10 22:59:47

hssm commented 9 years ago
With version 0.6beta6 the images are displayed and the zoom (after enabling it) works
really well. Unfortunately the sound doesn't play but hopefully this will be fixed
in the next beta versions. I am happy to close this issue on pictures and zoom. Thank
you for implementing it.

Reported by andershildebrandt on 2011-03-11 07:37:34

hssm commented 9 years ago
This is fixed in 1.0, isn't it?

Reported by ottenlips on 2011-12-26 15:40:51

hssm commented 9 years ago
I guess. Thanks for the tip!

Reported by nicolas.raoul on 2011-12-26 15:44:15