Mokuro: Read Japanese manga with selectable text inside a browser

That’s normal. And it’s not an issue, I’ve just checked.

That’s not the issue either, I’ve just checked

  • by changing the image type to png from jpeg
  • by renaming the files “Img_1.png” and not only 0001.png

Can you check if you don’t have hidden files in the zip ? Unzip your processed file, move to the folder (it should contain the html file, the mokuro file and the raw image folder) and either press down Command+Shift+ . (period key) or, in terminal, type

defaults write com.apple.Finder AppleShowAllFiles true

then Enter

then

killall Finder

then Enter

(to go back to hidden files, just type the same, but change true to false)

Do you have hidden (greyed out) files, usually named .DS_STORE and __MACOSX ?

As I told you, I used to have them all the time, and they caused problem, but it seems they no longer appear, and I’m guessing it might have to do with your OS version…

Also, can you try in Safari on Mac (not iOS) to load not the zipped file, but a folder, like this (same process as a zip file, but with “choose directory”) ?


Does this work ?

1 Like

Indeed there “was/is” an issue with said __MACOSX folder.
You had mentioned it before so I was aware of it.
I did get an error due to __MACOSX when attempting to mokuro ocr process without realizing at the time that macos had created a __MACOSX for the images.
The error occurred when I converted images from png → jpg. I did not realized that macos has hidden the __MACOSX!
Was forced to delete entire folder/images and start again with new manga/img and keep to png extension.

 error: __MACOSX/TheBlackMagicOfLamia/._IMG_0519.jpeg.

raise InvalidImage()
          └ <class 'mokuro.manga_page_ocr.InvalidImage'>

mokuro.manga_page_ocr.InvalidImage: Animation file, Corrupted file or Unsupported type
2024-07-28 22:16:15.365 | INFO     | mokuro.run:run:146 - Processed successfully: 0/1

Currently there are no error when performing a mokuro ocr process from original image format

I have confirmed that the same zipped file created earlier once unzipped

is working from macOS → chrome browser mokuro-reader app


Screenshot 2024-07-29 at 10.01.06

Can confirm the requested command on terminal:

 ~/mokuro-reader  defaults write com.apple.Finder AppleShowAllFiles true                                                                                                                                                                                                 ✔  10m 5s   myenv   01:14:45

 ~/mokuro-reader  killall Finder                                                                                                                                                                                                                                                    ✔  myenv   09:40:07

 ~/mokuro-reader 

can confirmed able to see hidden files:

Screenshot 2024-07-29 at 10.14.02

The contents of local mokuro-reader main directory:
My local main directory where the manga/img + .mokuro + html other folders is along with the zipped manga/img + .mokuro + html.

output

Gotta be honest I am stumped! Thanks in advance again for all your help and patients!

Used a new manga image type

used a publicly available manga but it was a pdf format that I converter to jpg with an online converter!

below I followed all the above step you provided and we have confirmed together above.

setup/config pyenv + python ver

pyenv install 3.9.12

pyenv global 3.9.12 

~/mokuro-reader  python --version     
  11:52:00 
Python 3.9.12

install mokuro

pip3 install mokuro

pip3 install mokuro  
Collecting mokuro
  Downloading mokuro-0.2.1-py3-none-any.whl (133 kB)

confirm mokuro

mokuro --version

0.2.1

mokuro process manga

confirm manga path location

 ~/mokuro-reader  ls -l
   12:02:58 
total 7080
drwx------@ 7 myUsers  staff      224  7 29 11:23 blackjack01
drwxr-xr-x@ 9 myUsers  staff      288  7 29 11:56 myenv
-rw-r--r--@ 1 myUsers  staff  3621404  7 29 11:22 smallpdf-convert-20240729-112211.zip

run mokuro command:

~/mokuro-reader  mokuro /Users/myUsers/mokuro-reader/blackjack01

Found 1 volumes:

/Users/myUsers/mokuro-reader/blackjack01 (unprocessed)

Each of the paths above will be treated as one volume.

2024-07-29 12:07:38.384 | INFO     | mokuro.run:run:133 - Processing 1/1: /Users/myUsers/mokuro-reader/blackjack01
Processing pages...:   0%|                                                                                                                                                                                                                                                                            | 0/5 [00:00<?, ?it/s]2024-07-29 12:07:38.897 | INFO     | mokuro.manga_page_ocr:__init__:41 - Initializing text detector, using device cpu
2024-07-29 12:07:39.442 | INFO     | manga_ocr.ocr:__init__:15 - Loading OCR model from kha-white/manga-ocr-base
2024-07-29 12:07:45.382 | INFO     | manga_ocr.ocr:__init__:28 - Using MPS
2024-07-29 12:08:02.084 | INFO     | manga_ocr.ocr:__init__:38 - OCR ready
Processing pages...: 100%|
5/5 [00:58<00:00, 11.77s/it]
2024-07-29 12:08:37.745 | INFO     | mokuro.run:run:146 - Processed successfully: 1/1

confirm output

Screenshot 2024-07-29 at 12.16.21

no hidden folder/files: __MACOSX

zip manga/img + .mokuro + .html

Screenshot 2024-07-29 at 12.18.45

confirm output

Screenshot 2024-07-29 at 12.21.13

place zipped file in iCloud

Screenshot 2024-07-29 at 12.23.00

clear safari data/history cache

mokuro-reader upload zipped file



WOW Nothing!

1 Like

Curiouser and curiouser…

So the Mokuro process in itself works fine

Still, we’ve whittled down to either something wrong with the zip (but why ?) or with iOS Safari (but why ?)

Can you :

  • check that the zipped file works in Mac Safari ?
  • check if the zipped file works in another iOS browser (chrome/orion/whatever …) ?

And just in case, even though I don’t see why it would change anything, clear the mokuro catalog ?

Also, you seem to have some safari extensions running on the Mokuro page (puzzle piece icon on the left of the address bar). Could there be something in here that’s interfering (ad blocker/pop-up blocker/whatever) ? Though obviously not 10ten, that works.

1 Like

Any chance that you could get his zip file and try it or the other way around, send them a zip file that you have tested OK? Maybe just take a random jpg from the internet

1 Like

This is exactly what’ve been meaning to try but didn’t know how to go about it. :thinking:
Maybe I can send a link to my google drive with the zip file in question!? @Magyarapointe
Would love to try out your zip file as well!

1 Like

I’ve thought about this too, too bad there’s no DM in these forums. I’m sending you an email (then you can delete your address from the forum…)

2 Likes

Understood and thanks.

1 Like

I have confirmed that the zip created from your machine is working flawlessly!
Ok now what exactly does this mean! On my local env :thinking:

Will take your zip and unzip followed by
Using mokuro on pluto then go through that process with pluto. See what happens!


@Akashelia Thanks for pointing out the verification of the zip.

1 Like

You were right!! The issue is my macOS archiver tool compress!
I used google’s zipping process to create my own zip file and it worked.
I guess this was exactly what I did the first time without realizing it and uploaded to mokuro-reader successfully but was not able to successfully reproduce the same results after zipping from my local machine!

Thanks again for all of your help and support.
Will provide you with an update shortly after replacing my zipping tool.

3 Likes

Yay :grin: I love it when we get a happy ending in this thread! Good job on sticking with trying until you got it and all the super detailed reports and thanks @Magyarapointe for the help!!

2 Likes

Glad I could help !

Some last screenshots in case someone else runs into the same problem

When I tried to download @3thancr0wn 's file from Google Drive, this is what I saw

The hidden files I suspected were there all along. They are (or were, because on my newer MacOS, it doesn’t happen) created when you zip a file on Mac

And there’s the script to remove them

mac - How to stop the hidden __MACOSX folder from being created when compressing files/folders in Finder - Ask Different.

after running that on the zip

(I don’t know why they didn’t show up when you checked on your computer, though)

TL;DR : if you’re zipping files on Mac, quite often, hidden files are created which can mess with programs. Try getting rid of those, you should be fine afterwards.

2 Likes

My god! Even after purposely looking for it! I will be dealing with permanently!
You’ve given me yet another reason as to why I really NEED my apple M2 chip :cookie:
Thanks for the link on how to deal with the __MACOSX folder.

1 Like

Here to trouble ya’ll again! I’m trying to install Mokuro on another device, and I’ve followed the same installation process as before (I even had everything written down from last time).

I’ve downloaded Python and made sure to check the box labeled “Add Python to PATH.” However, the pip3 install mokuro command doesn’t seem to work. I also tried uninstalling and reinstalling everything several times.

Is this how it’s supposed to look?

images

What am I doing wrong? T_T

Which version of python? I believe it should be 3.9.13

1 Like

Looks like 3.12 based on the screenshots.

Is there a consensus on which version of Python is needed for each major operating system? I have it working with 3.11.8 on Linux. If we had a list of which ones it does and does not work with, I could add it to the first post.

Does running this help any?

pip3 install --upgrade setuptools

That should install/upgrade pkg_resources.

2 Likes

For Windows, I wrote in one of my posts “Install Python 3.10 and not newer”, I don’t remember where I got that from, when I look at GitHub - kha-white/mokuro: Read Japanese manga inside browser with selectable text. it just says “You need Python 3.6 or newer”. But I believe it still holds. People have had success with 3.9 but not with newer than 3.10.
I think it’s a good idea to put it in the first post.

1 Like

I installed the 3.12 version this time, but I remember trying it with the 3.9 one too :thinking:

this worked!!! thank you both :bowing_man:

3 Likes

Alright then my comment doesn’t hold after all :joy: but good news!!

1 Like

Ahh okay so I installed Mokuro and tried it out with one manga, but Yomitan still can’t scan the text, even though the HTML file was created. Let me try using Python 3.9 lol

1 Like