quran / quran_android

a quran reading application for android
http://android.quran.com
GNU General Public License v3.0
2.01k stars 890 forks source link

Ayah highlight borders are off on Android 5.1 #516

Closed ozbek closed 9 years ago

ozbek commented 9 years ago

Please see the attached screenshots.

tmp_4276-screenshot_2015-04-07-23-44-52-472252166

tmp_4276-screenshot_2015-04-07-23-45-16483674180

tmp_4276-screenshot_2015-04-07-23-45-28366550601

ozbek commented 9 years ago

The issue seems to be relevant only for the first and the second pages.

tmp_4276-screenshot_2015-04-08-00-01-42-544736183

tmp_4276-screenshot_2015-04-08-00-02-00404140771

ahmedre commented 9 years ago

what ayahinfo file do you have and what images?

ozbek commented 9 years ago

OK, I had both width_1260/ayahinfo_1260.db and width_1920/ayahinfo_1920.db. Probably, _1920 are left over from old times.

Deleting /sdcard/quran_android and re-downloading everything fixed the problem. Thanks.

ahmedre commented 9 years ago

hmm... other people complained about this also - it seems like it must have been using the 1920 ayahinfo instead of the 1260 one. we should likely fix this.

ozbek commented 9 years ago

For reference, here is the file structure after cleanup and re-download:

.
└── sdcard
    └── quran_android
        ├── databases
        │   ├── ayahinfo_1260.db
        │   └── quran.ar.db
        └── width_1260
            ├── page001.png
            ├── page002.png
            ├── page003.png
            └── ....png
ahmedre commented 9 years ago

i've spent some time thinking about this and looking at the code... here are some observations:

  1. there should be no way for 1260 images to download unless the 1920 images on the device are incomplete.
  2. if the 1920 images are complete and the 1260 images are used, those images should be used and their ayahinfo should be used as well (especially since this is a phone).
  3. the data in the screenshot above is actually correct - it's just not shifted down properly. as an experiment, i copied the 1920 database and renamed it as the 1260 one - the result is completely off (unlike your screenshots, where it's off in the y axis only).

no real ideas... any thoughts?

ozbek commented 9 years ago

There was a switch from 1920 to 1260 sometime during the development, wasn't there? I might have partially downloaded 1920 images before that switch and continue using the app with that old data afterwards.

ahmedre commented 9 years ago

just encountered this on a device with 1024 and i think i know what happened - some of the ayahinfo databases are pointing to the incorrect data (old data) and some are pointing to the new data. if you download the patch/update, you have the new data, but if the ayahinfo database goes away for whatever reason, it will try to pull it from the old data source. the new version should ideally contain the fix for this since it changes the url from which it reads ayahinfo databases.

ahmedre commented 9 years ago

i found a way to repro this - clear /sdcard/quran_android, then re-run, but don't download the pages. long press and download the ayahinfo database. hit back and go back in (due to #531). long press. highlighting will be off for pages 1 and 2 because the images are the old images and the database is the new database.

ahmedre commented 9 years ago

the fix for this is on the server side, to copy the new page 1 and 2 (and whatever other pages changed) to the page by page downloads.

ahmedre commented 9 years ago

this was already done, so closing this.

muhammedrasheed commented 9 years ago

How i can used ayah detection

ahmedre commented 9 years ago

the code used in Quran for Android is not using the ayah-detection project - since we write the images, we know where we write each word, so we store the information in a database. I believe that ayah-detection may have been used for Qaloon though.