Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Unable to create font using jpg #67

Open
programmer290399 opened this issue Nov 28, 2021 · 1 comment
Open

BUG: Unable to create font using jpg #67

programmer290399 opened this issue Nov 28, 2021 · 1 comment

Comments

@programmer290399
Copy link

programmer290399 commented Nov 28, 2021

  • Traceback:
❯ handwrite Downloads/sa\ handwrite\ font_1\ \(1\).jpg .
Traceback (most recent call last):
  File "/home/saahil/anaconda3/envs/handwrite/bin/handwrite", line 8, in <module>
    sys.exit(main())
  File "/home/saahil/anaconda3/envs/handwrite/lib/python3.7/site-packages/handwrite/cli.py", line 57, in main
    args.input_path, args.output_directory, args.directory, args.config, metadata
  File "/home/saahil/anaconda3/envs/handwrite/lib/python3.7/site-packages/handwrite/cli.py", line 34, in converters
    run(sheet, output_directory, directory, config, metadata)
  File "/home/saahil/anaconda3/envs/handwrite/lib/python3.7/site-packages/handwrite/cli.py", line 12, in run
    SHEETtoPNG().convert(sheet, characters_dir, config)
  File "/home/saahil/anaconda3/envs/handwrite/lib/python3.7/site-packages/handwrite/sheettopng.py", line 49, in convert
    characters_dir,
  File "/home/saahil/anaconda3/envs/handwrite/lib/python3.7/site-packages/handwrite/sheettopng.py", line 160, in save_images
    images[0],
cv2.error: OpenCV(4.5.4) /tmp/pip-req-build-3129w7z7/opencv/modules/imgcodecs/src/loadsave.cpp:799: error: (-215:Assertion failed) !_img.empty() in function 'imwrite'
  • Dependencies:
❯ fontforge -v
Copyright (c) 2000-2021. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20201107
 Based on sources from 2021-11-27 12:18 UTC-ML-D-GDK3.
 Based on source from git with hash: 58238cc173c80379d0d4616971fc793da26c6aa4
fontforge 20201107
build date: 2021-11-27 12:18 UTC
❯ potrace -v
potrace 1.16. Copyright (C) 2001-2019 Peter Selinger.
Library version: potracelib 1.16
Default unit: inches
Default page size: letter
❯ conda list
# packages in environment at /home/saahil/anaconda3/envs/handwrite:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
_openmp_mutex             4.5                       1_gnu  
ca-certificates           2021.10.26           h06a4308_2  
certifi                   2021.10.8        py37h06a4308_0  
handwrite                 0.3.0                    pypi_0    pypi
ld_impl_linux-64          2.35.1               h7274673_9  
libffi                    3.3                  he6710b0_2  
libgcc-ng                 9.3.0               h5101ec6_17  
libgomp                   9.3.0               h5101ec6_17  
libstdcxx-ng              9.3.0               hd4cf53a_17  
ncurses                   6.3                  h7f8727e_2  
numpy                     1.21.4                   pypi_0    pypi
opencv-python             4.5.4.60                 pypi_0    pypi
openssl                   1.1.1l               h7f8727e_0  
pillow                    8.4.0                    pypi_0    pypi
pip                       21.2.2           py37h06a4308_0  
python                    3.7.11               h12debd9_0  
readline                  8.1                  h27cfd23_0  
setuptools                58.0.4           py37h06a4308_0  
sqlite                    3.36.0               hc218d9a_0  
tk                        8.6.11               h1ccaba5_0  
wheel                     0.37.0             pyhd3eb1b0_1  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
  • Images used:

sa handwrite font_1 (1)
Fitted to A4 size using Adobe Scan

sa_handwrite_font_1
Original image scanned using Adobe Scan

  • Operating system used:
❯ neofetch 
██████████████████  ████████   saahil@saahil-gl638rd 
██████████████████  ████████   --------------------- 
██████████████████  ████████   OS: Manjaro Linux x86_64 
██████████████████  ████████   Host: GL63 8RD REV:1.0 
████████            ████████   Kernel: 5.10.79-1-MANJARO 
████████  ████████  ████████   Uptime: 4 hours, 59 mins 
████████  ████████  ████████   Packages: 1564 (pacman) 
████████  ████████  ████████   Shell: bash 5.1.8 
████████  ████████  ████████   Resolution: 1920x1080 
████████  ████████  ████████   WM: i3 
████████  ████████  ████████   Theme: Matcha-dark-sea [GTK2], Numix [G 
████████  ████████  ████████   Icons: Papirus-Dark [GTK2/3] 
████████  ████████  ████████   Terminal: kitty 
████████  ████████  ████████   CPU: Intel i7-8750H (12) @ 4.100GHz 
                               GPU: NVIDIA GeForce GTX 1050 Ti Mobile 
                               GPU: Intel CoffeeLake-H GT2 [UHD Graphi 
                               Memory: 3189MiB / 15850MiB
  • Tried both conda and python venv environments, but it failed in both with the same error shared above.
  • Python version 3.7
@programmer290399 programmer290399 changed the title BUG: Unable to create font using jpeg BUG: Unable to create font using jpg Nov 28, 2021
@yashlamba
Copy link
Member

yashlamba commented Nov 28, 2021

HI @programmer290399, this looks like a fair enough input, I'll try it out and let you know if I find the reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants