Giter Site home page Giter Site logo

colindean / optar Goto Github PK

View Code? Open in Web Editor NEW
100.0 7.0 18.0 63 KB

OPTical ARchiver - highly compressed 2D barcode for paper or film archiving of digital data

Home Page: http://ronja.twibright.com/optar/

License: GNU General Public License v2.0

C 40.61% Objective-C 57.56% Shell 0.41% Makefile 1.42%

optar's Issues

Unoptar does not compile

When running make, I get the following:

% make
gcc -c  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o optar.o optar.c
gcc -c  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o common.o common.c
gcc -c  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o golay.o golay.c
gcc -c  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o parity.o parity.c
gcc -lm -o golay golay.o parity.o
./golay > golay_codes.c
gcc -c  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o golay_codes.o golay_codes.c
gcc -lm -o optar optar.o common.o golay_codes.o parity.o
gcc -c -I/usr/local/include/libpng  -O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops -fstrength-reduce -DNODEBUG `libpng-config --I_opts` -o unoptar.o unoptar.c
gcc -lm -o unoptar -L/usr/local/lib -lpng -lz unoptar.o common.o golay_codes.o parity.o
unoptar.o: In function `get_pixel_interp':
unoptar.c:(.text+0x2a): undefined reference to `floor'
unoptar.c:(.text+0x6e): undefined reference to `floor'
unoptar.o: In function `mark':
unoptar.c:(.text+0x1f3): undefined reference to `floor'
unoptar.c:(.text+0x20e): undefined reference to `floor'
unoptar.o: In function `mark_bad_bit':
unoptar.c:(.text+0x301): undefined reference to `floor'
unoptar.c:(.text+0x3e71): undefined reference to `sqrt'
unoptar.o: In function `dump_newary':
unoptar.c:(.text+0x3ebb): undefined reference to `pow'
unoptar.c:(.text+0x3ede): undefined reference to `floor'
unoptar.c:(.text+0x3f09): undefined reference to `pow'
unoptar.c:(.text+0x3f2c): undefined reference to `floor'
unoptar.c:(.text+0x3f57): undefined reference to `pow'
unoptar.c:(.text+0x3f7a): undefined reference to `floor'
unoptar.c:(.text+0x3fa7): undefined reference to `pow'
unoptar.c:(.text+0x3fca): undefined reference to `floor'
unoptar.o: In function `print_badbit':
unoptar.c:(.text+0x443d): undefined reference to `floor'
unoptar.c:(.text+0x445f): undefined reference to `floor'
unoptar.o: In function `read_png':
unoptar.c:(.text+0x4f0a): undefined reference to `png_create_read_struct'
unoptar.c:(.text+0x4f15): undefined reference to `png_create_info_struct'
unoptar.c:(.text+0x4f27): undefined reference to `png_init_io'
unoptar.c:(.text+0x4f32): undefined reference to `png_read_info'
unoptar.c:(.text+0x4f3d): undefined reference to `png_get_image_width'
unoptar.c:(.text+0x4f4e): undefined reference to `png_get_image_height'
unoptar.c:(.text+0x4fac): undefined reference to `png_get_gAMA'
unoptar.c:(.text+0x4fcb): undefined reference to `png_set_gamma'
unoptar.c:(.text+0x4fd6): undefined reference to `png_get_color_type'
unoptar.c:(.text+0x4fe8): undefined reference to `png_get_bit_depth'
unoptar.c:(.text+0x5026): undefined reference to `png_set_interlace_handling'
unoptar.c:(.text+0x5034): undefined reference to `png_read_update_info'
unoptar.c:(.text+0x5257): undefined reference to `png_read_rows'
unoptar.c:(.text+0x529e): undefined reference to `png_read_rows'
unoptar.c:(.text+0x52b9): undefined reference to `png_read_rows'
unoptar.c:(.text+0x52d4): undefined reference to `png_read_rows'
unoptar.c:(.text+0x52ef): undefined reference to `png_read_rows'
unoptar.o:unoptar.c:(.text+0x530a): more undefined references to `png_read_rows' follow
unoptar.o: In function `read_png':
unoptar.c:(.text+0x534c): undefined reference to `png_set_gamma'
unoptar.c:(.text+0x5366): undefined reference to `png_set_expand'
unoptar.c:(.text+0x537f): undefined reference to `png_set_rgb_to_gray'
unoptar.c:(.text+0x5398): undefined reference to `png_set_strip_alpha'
unoptar.c:(.text+0x53bb): undefined reference to `png_set_rgb_to_gray'
unoptar.c:(.text+0x53db): undefined reference to `png_read_rows'
unoptar.c:(.text+0x53ee): undefined reference to `png_read_rows'
unoptar.c:(.text+0x5401): undefined reference to `png_read_rows'
unoptar.c:(.text+0x5414): undefined reference to `png_read_rows'
unoptar.c:(.text+0x5427): undefined reference to `png_read_rows'
unoptar.o:unoptar.c:(.text+0x543a): more undefined references to `png_read_rows' follow
unoptar.o: In function `read_png':
unoptar.c:(.text+0x5478): undefined reference to `png_read_end'
unoptar.c:(.text+0x54a4): undefined reference to `png_set_expand'
unoptar.c:(.text+0x54b4): undefined reference to `png_set_strip_16'
unoptar.o: In function `main':
unoptar.c:(.text.startup+0x1113): undefined reference to `sqrtf'
unoptar.c:(.text.startup+0x113b): undefined reference to `sqrtf'
unoptar.c:(.text.startup+0x119b): undefined reference to `floor'
unoptar.c:(.text.startup+0x11fd): undefined reference to `floor'
unoptar.c:(.text.startup+0x23c7): undefined reference to `sqrt'
unoptar.c:(.text.startup+0x2432): undefined reference to `sqrt'
unoptar.c:(.text.startup+0x24b3): undefined reference to `asin'
unoptar.c:(.text.startup+0x256a): undefined reference to `asin'
unoptar.c:(.text.startup+0x2615): undefined reference to `asin'
unoptar.c:(.text.startup+0x26b5): undefined reference to `asin'
unoptar.c:(.text.startup+0x274d): undefined reference to `remainder'
unoptar.c:(.text.startup+0x4738): undefined reference to `floor'
unoptar.c:(.text.startup+0x4752): undefined reference to `floor'
unoptar.c:(.text.startup+0x4c90): undefined reference to `floor'
unoptar.c:(.text.startup+0x4d2b): undefined reference to `sqrt'
unoptar.c:(.text.startup+0x4d55): undefined reference to `floorf'
unoptar.c:(.text.startup+0x55ac): undefined reference to `sqrtf'
unoptar.c:(.text.startup+0x55c3): undefined reference to `sqrtf'
unoptar.c:(.text.startup+0x6346): undefined reference to `floor'
unoptar.c:(.text.startup+0x6bc7): undefined reference to `floor'
unoptar.c:(.text.startup+0x6be9): undefined reference to `floor'
unoptar.c:(.text.startup+0x6c19): undefined reference to `floor'
unoptar.c:(.text.startup+0x6f3c): undefined reference to `floor'
unoptar.o:unoptar.c:(.text.startup+0x6f68): more undefined references to `floor' follow
unoptar.o: In function `main':
unoptar.c:(.text.startup+0x83d1): undefined reference to `asin'
unoptar.c:(.text.startup+0x842f): undefined reference to `asin'
unoptar.c:(.text.startup+0x8488): undefined reference to `asin'
unoptar.c:(.text.startup+0x8500): undefined reference to `asin'
collect2: error: ld returned 1 exit status
make: *** [unoptar] Error 1

I'm running Ubuntu 12.10, 64-bit.

I found a hint over at http://chaource.livejournal.com/87817.html but had no luck with any permutation of "-lm -lpng".

Failed to decode and unexpected behavior with custom configuration

Hi. I tried to conduct some tests to determine the most suitable parameters for my printer and scanner. I succeeded in compiling the project on my M2 chip Mac, and the printer/scanner I use is an Apeos C6570, which is supposed to print/scan with 600+ dpi. I choose a file and then use five different settings of XCROSSES and YCROSSES to compile, and then print/scan on A4 paper using the same parameters. Here is the decode result:

Group XCROSSES YCROSSES rate% of irreparable
1 65(default) 93(default) 9.8574
2 59 84 51.5284
3 52 74 51.6052
4 46 65 51.5284
5 39 56 51.8302

It can be noticed that the proportion of irreparable behaves very strangely (rising and extremely close). Here I attach the 100% zoom of scans from group 1 and group 5:
ๅ›พ็‰‡

Any idea for the reason? Thanks for any suggestions.

Fail to decode after printing: Error: cannot find upper left corner

I'm printing a file that fits on one single A4 page. The printed version looks good.

However, when decoding after scanning, I hit Error: cannot find upper left corner

Any idea to fix that?

Thanks a lot for the great project! --Martin

$ ./unoptar 0-65-93-24-3-1-2-24 02_sound > foo 
Format: text height=24
Unformatted channel capacity 433.267 kB, formatted raw channel capacity 399.546 kB, net Golay payload capacity 199.773 kB, 133182 Golay symbols, 0 bits unused (incomplete Hamming symbol), border taking 1.50439% of unformatted capacity, border with crosses taking 7.78285% of unformatted capacity, border with crosses and Golay taking 53.8914% of unformatted capacity.
Decoding PNG file 02_sound_0001.png...
Input 595 x 841 pixels, taking 1.00079 megabytes for 2 framebuffers.
Average pixel value 226
Black 40.3372, white 254.53, cutlevel 62 (0x3e), fill cutlevel 147 (0x93)
Black 16.6485, white 251.518, cutlevel 40 (0x28), fill cutlevel 134 (0x86)
Black 12.8823, white 249.818, cutlevel 37 (0x25), fill cutlevel 131 (0x83)
Black 12.3657, white 249.524, cutlevel 36 (0x24), fill cutlevel 131 (0x83)
Black 12.2164, white 249.445, cutlevel 36 (0x24), fill cutlevel 131 (0x83)
Removing dirt from the white border: white border identified, data area identified, erased 64496 pixels of dirt.
Searching for the corners.
Error: cannot find upper left corner
See failure_debug.pgm why.

Technical explanation of how it works

I and many others would greatly appreciate it.

My biggest concern is being able to recreate the source code if ever I need to in the future, but I need to understand be able to easily understand what techniques are employed here ๐Ÿ˜„

Thank you!

I would also like to know how you came up with using Golay codes.

Python, JS and Go version of the software

Objective C is being deprecated over Swift, so if it is possible, please have these versions ready.

  • Python (a good scripting language)
  • JS (for web-based implementation)
  • Go (A Java/C#/Swift/Kotlin replacement)

Add GitHub release

Since the original tool is no longer maintained, I also thought about archiving the sources on GitHub and fixing minor things. But I saw that you already did that. :)

How about spinning a v1.0.1 (or 1.0.0-r1 - as the fixes you added were only build-fixes and not actual updates to the software) and adding a GitHub release - I'd package this for Gentoo then. :-)

Online version

An online version of Optar could be awesome! I know it can be a lot of work but I am sure it could become a great inspiration for archive projects, art, and research. I don't have the skills to do such a fork, at least not the dev part. Maybe we can talk about that?
Awesome idea by the way. I am part of a collective named http://webarchivists.org/ and we love your project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.