Giter Club home page Giter Club logo

inklingreader's People

Contributors

bpeter-seibert avatar divosolutions avatar merax avatar roelj avatar su-v avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inklingreader's Issues

Memory consumption

I've been debugging parts of InklingReader to minimize its memory usage and I've found various problems so far.

Just to keep you up to date: I'm cleaning up the code we have so far before I'm going to solve the other issues.

build fails (version 0.8 and dev): mainwindow.c: undefined reference to `gtk_

Hello @roelj

I'm trying to compile the latest version of the software to take some screenshots and work on the #39.
But it fails in the same way both on the lastes version in master and in the latest release 0.8.

With code from master, I get errors like this:

  CCLD   inklingreader
src/gui/mainwindow.o: In function `gui_mainwindow_toggle_timing':
~/inklingreader/src/gui/mainwindow.c:998: undefined reference to `gtk_widget_is_visible'
src/gui/mainwindow.o: In function `gui_mainwindow_toggle_settings':
~/inklingreader/src/gui/mainwindow.c:985: undefined reference to `gtk_widget_is_visible'
src/gui/mainwindow.o: In function `gui_mainwindow_file_activated':
~/inklingreader/src/gui/mainwindow.c:612: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:612: undefined reference to `gtk_header_bar_set_title'
src/gui/mainwindow.o: In function `gui_mainwindow_init':
~/inklingreader/src/gui/mainwindow.c:133: undefined reference to `gtk_header_bar_new'
~/inklingreader/src/gui/mainwindow.c:134: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:134: undefined reference to `gtk_header_bar_set_show_close_button'
~/inklingreader/src/gui/mainwindow.c:135: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:135: undefined reference to `gtk_header_bar_set_title'
~/inklingreader/src/gui/mainwindow.c:136: undefined reference to `gtk_window_set_titlebar'
~/inklingreader/src/gui/mainwindow.c:147: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:147: undefined reference to `gtk_header_bar_pack_start'
~/inklingreader/src/gui/mainwindow.c:148: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:148: undefined reference to `gtk_header_bar_pack_start'
~/inklingreader/src/gui/mainwindow.c:149: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:149: undefined reference to `gtk_header_bar_pack_end'
~/inklingreader/src/gui/mainwindow.c:150: undefined reference to `GTK_HEADER_BAR'
~/inklingreader/src/gui/mainwindow.c:150: undefined reference to `gtk_header_bar_pack_end'
~/inklingreader/src/gui/mainwindow.c:276: undefined reference to `gtk_button_new_from_icon_name'
~/inklingreader/src/gui/mainwindow.c:277: undefined reference to `gtk_button_new_from_icon_name'
~/inklingreader/src/gui/mainwindow.c:278: undefined reference to `gtk_button_new_from_icon_name'
collect2: error: ld returned 1 exit status
make: *** [inklingreader] Erreur 1

and compiling version 0.8:

  CC     src/main.o
  CC     src/gui/mainwindow.o
src/gui/mainwindow.c: In function ‘gui_mainwindow_init’:
src/gui/mainwindow.c:142:15: warning: assignment makes pointer from integer without a cast [enabled by default]
src/gui/mainwindow.c:143:16: warning: assignment makes pointer from integer without a cast [enabled by default]
src/gui/mainwindow.c:144:18: warning: assignment makes pointer from integer without a cast [enabled by default]
src/gui/mainwindow.c:145:19: warning: assignment makes pointer from integer without a cast [enabled by default]
  CC     src/converters/svg.o
  CC     src/converters/png.o
  CC     src/converters/json.o
  CC     src/converters/pdf.o
  CC     src/parsers/wpi.o
  CC     src/high/conversion.o
  CC     src/datatypes/configuration.o
  CC     src/optimizers/point-reduction.o
  CCLD   inklingreader
src/gui/mainwindow.o: In function `gui_mainwindow_init':
~/inklingreader-0.8/src/gui/mainwindow.c:142: undefined reference to `gtk_button_new_from_icon_name'
~/inklingreader-0.8/src/gui/mainwindow.c:143: undefined reference to `gtk_button_new_from_icon_name'
~/inklingreader-0.8/src/gui/mainwindow.c:144: undefined reference to `gtk_button_new_from_icon_name'
~/inklingreader-0.8/src/gui/mainwindow.c:145: undefined reference to `gtk_button_new_from_icon_name'
collect2: error: ld returned 1 exit status
make: *** [inklingreader] Erreur 1

Not sure if I did something wrong or not.

Compiling on Debian stable fails (aclocal-1.14 missing)

Running ./configure and then make.
Here is the error on make:

CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /home/juego/inklingreader/missing aclocal-1.14 
/home/juego/inklingreader/missing: ligne81: aclocal-1.14 : commande introuvable
WARNING: 'aclocal-1.14' is missing on your system.
         You should only need it if you modified 'acinclude.m4' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'aclocal' program is part of the GNU Automake package:
         <http://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <http://www.gnu.org/software/autoconf>
         <http://www.gnu.org/software/m4/>
         <http://www.perl.org/>
make: *** [aclocal.m4] Erreur 127

Googled a bit but can't find an answer to help me.
Do you have any suggestions?

Paper sizes

A feature request I mentioned already in #20 discussion but moved here for clarity:

The user could maybe determine a canvas size while loading the drawing. Let's say if someone draws on a A4, A5 or A6, in portrait or landscape. Because when you draw, you usually draw in relation to the limits of the paper you're drawing on and work on the composition of that drawing in the page. So maybe if the user would say what are the page dimensions he or she was working on, the composition could be kept in the output file. (It could be presets like A3_landscape or A5_portrait. or 200x200mm). That, I think, would be a useful option.

Note: It's also a feature available in the "official" wacom software.

License headers of the Inkscape extension

Could you add GPLv2+ license headers to the Inkscape extension files ("wpi2svg-ext.py" and "wpi_input.inx")?

In that case I can ship the extension along with the program as an official GNU package :).

An example is:

/*
* Copyright (C) 2013 {Your name/nickname and/or e-mail}
*
* This file is part of InklingReader
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see (http://www.gnu.org/licenses/).
*/

Adjust the comment style to the programming language specific comment style.

New warnings with clang on OS X 10.7.5

When compiling current master (@5a16b6e14a5445de597f5a1f8d02e91186f48cdf) on OS X 10.7.5 with clang (based on LLVM 3.1svn), there's still a warning related to malloc:

  CC       src/gui/mainwindow.o
src/gui/mainwindow.c:108:21: warning: implicitly declaring C library function 'malloc' with type 'void *(unsigned long)'
      int* number = malloc (sizeof (int));
                    ^
src/gui/mainwindow.c:108:21: note: please include the header <stdlib.h> or explicitly provide a declaration for 'malloc'
1 warning generated.

This diff makes the warning go away (same was used in other places where 'malloc.h' is included):

diff --git a/src/gui/mainwindow.c b/src/gui/mainwindow.c
index 645a97e..fc9a1af 100644
--- a/src/gui/mainwindow.c
+++ b/src/gui/mainwindow.c
@@ -22,6 +22,7 @@
 #include "../datatypes/configuration.h"
 #include <gtk/gtk.h>

+#include <stdlib.h> 
 #ifndef __APPLE__
 #include <malloc.h>
 #endif

and another (new) warning later on:

  CC       src/high/configuration.o
src/high/configuration.c:107:19: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
      while (read = getline (&line, &line_len, file) != -1)
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/high/configuration.c:107:19: note: place parentheses around the assignment to silence this warning
      while (read = getline (&line, &line_len, file) != -1)
                  ^
             (                                            )
src/high/configuration.c:107:19: note: use '==' to turn this assignment into an equality comparison
      while (read = getline (&line, &line_len, file) != -1)
                  ^
                  ==
1 warning generated.

Note: I used this sequence of commands, with an otherwise unmodified checkout of master:

$ touch AUTHORS NEWS
$ autoreconf -i
$ CC=clang ./configure --prefix="$HOME/.local"
$ make

No lines displayed at all if the first coordinate is out of bounds

I have a sketch were nothing is display.

I have debugged the problem so far that apparently the first coordinate is "out of bounds". The correction logic of the rendering will ignore those coordinates.
But if the first coordinate is out of bounds it will see all the following coordinates as being out of bounds and therefore not draw anything.

I am currently working on a fix by looking at more than just the last and the current coordinate in order to make that decision.

Raw data

000095.000000: CLOCK          96
000096.000000: CLOCK          97
000097.000000: COORDINATE   1558.000000,      5.000000 skip
000097.006554: STROKE      START
000097.006554: COORDINATE    645.000000,  11059.000000 skip
000097.013107: PRESSURE       97.013107
000097.013107: TILT          217, 217
000097.013107: COORDINATE    646.000000,  11059.000000
000097.019661: PRESSURE       97.019661
000097.019661: TILT          217, 217
…

WPI SVG and RAW Data: nothing-displayed-14.zip

Add the possibility to have transparent background

It would be great to be able to choose a transparent background or no background at all. So the exported svg would miss this line:
<g inkscape:label="Background" inkscape:groupmode="layer" id="layer0"><rect style="fill:#ffffff;stroke:none" id="background" width="210mm" height="297mm" x="0" y="0" /></g>

I'm asking this 'cause I found out it's the first thing I remove everytime I edit the resulting file in Inkscape. Could be usefull to have this as a command-line option also.

Approach for stroke with.

To keep issues clean, I start a new one to add something to Roeljs taught about stroke width #2 (comment)

Given the 3 points (x1,y1), (x2,y2), (x3,y3) and pressures p1,2 and p2,3 between this points I made a sketch how to acess the problem with the stroke width:
stroke_width
w is taught as an factor to link the pressure and the stroke width (should be configurable in the end). The black lines are parallel to the connection line between adjacent points.
To find the edges of the filled outline, we have to calculate the red marked intersections (A2,B2) and (a2,b2).

If the pressure is not given as the pressure in between two points but as an information for one point we can make a similar approach:
stroke_with2
The dashed lines are authogonal to the two strokes and the green line is just in the middle of these two, such that the blue angular are the same. Once we have the green line, we can calculate the red marks as edges of the outline.

To solve one or the other approach, we have to do some linear maths. If you want me to, I can help you with that and figure out equations to calculate the edges for given x1, x2, x3, y1, y2, y3 and pressures.

Pressure bug?

While trying to come up with dummy file, I think I encountered a bug in the interpretation of the pressure data. Or maybe it's the pen itself that bugged.

Here is a link to the WPI file: http://xuv.be/static/inkling/tree.WPI
And what it looks like when converted to svg.

wpi-pressure-bug

I also have to tell you that the line that draws the contour of the tree was much much longer on paper. I have no idea why it stopped recording at 3/4 of it.

Not all Lines are displayed, but the WPI parser seems to have them.

Hello Everyone,
I compiled inklingreader on an ARM platform(The OpenPandora to be precise) in an Ubunto chroot . But the majority of the Lines are not Displayed and Exported:
inkling1
however, when i modify src/parser/wpi.c to print all the x and y coordinates (by adding "printf("%i %i\n",(int)coordinate->y,(int)coordinate->x);" to line 141) and display them in gnuplot all the Lines are there:
inkling3
but it looks like there's some warping:
inkling2

I also have the Same issue on my PC(debian 8.3 amd64), but its not that bad:
inkling5

I hope you can Fix these issues.

Trouble with librsvg when using ./configure or autoreconf -i

I should preface this with the fact that I am new to compiling software. I have read everything in this github and made many queries to google.

I am using Ubuntu Studio 16.04LTS which when queried tells me I have the latest version of librsvg. It appears to be stored in the directory /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders. The file is libpixbufloader-svg.so. I have tried to download a new librsvg but the OS repeats that I have the most recent version. Am I right with this?

./configure and autoreconf -i now want me to do something with either PKG_CONFIG_PATH environment variable if software installed in a non-standard prefix or set environment variables rsvg_CFLAGS and rsvg_LIBS to avoid calling pkg-config.

Now I am totally lost. Can you please help. Thanks.

WPI format hacking

In an effort to figure out more about the WPI format I'd like to share some samples with you of what I extracted from the format. If it rings any bells, please let me know. If you're interested in hacking on the format yourself, I could push my changes into a separate branch so you can play with it as well.

First the data is expressed in integers, after the ":" the same data is displayed as characters. My sample can be downloaded here: 194_6_output.txt.

Display of drawing broken (possible svg malformed)

When opening a .WPI file in the GUI, this is the error I get:

(inklingreader:16909): librsvg-CRITICAL **: rsvg_handle_render_cairo_sub: assertion `handle != NULL' failed

Although, when I transform the same WPI file through command-line, I get an svg file without error. But I can't open that file in Inkscape or Viewnior.

The difference between the two svg files are on line 6 & 7.
Here an example:

Now (broken):

<title>test.svg</title>
<g inkscape:label="Background" inkscape:groupmode="layer" id="layer0"><rect style="fill:#ffffff;stroke:none" id="background" width="210mm" height="297mm" x="0" y="0" /></g>

Before:

<g inkscape:label="Background" inkscape:groupmode="layer" id="layer0"><rect style="fill:#ffffff;stroke:none" id="background" width="210mm" height="297mm" x="0" y="0" /></g>
<g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1">

Don't know why the name of the svg filename ended up in between a <title></title> tag.

Compile issue on ubuntu 12.04 precise

Hey roelj,

this project looks really interesting. I just copied your your project and tried to compile it. I'm running a 64bit precise and have (at least) installed these packages:
libgtk-3-dev, libcairo2-dev, build-essential, librsvg2-dev, libglib2.0-dev

The output of make is:

gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o main.o src/main.c
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o mainwindow.o src/gui/mainwindow.c
src/gui/mainwindow.c: In Funktion »gui_init_mainwindow«:
src/gui/mainwindow.c:57:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_new« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:57:12: Warnung: Zuweisung erzeugt Zeiger von Ganzzahl ohne Typkonvertierung [standardmäßig aktiviert]
src/gui/mainwindow.c:77:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_set_direction« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:77:3: Warnung: Implizite Deklaration der Funktion »GTK_MENU_BUTTON« [-Wimplicit-function-declaration]
src/gui/mainwindow.c:78:3: Warnung: Implizite Deklaration der Funktion »gtk_menu_button_set_popup« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o mainwindow_sig.o src/gui/mainwindow_sig.c
src/gui/mainwindow_sig.c: In Funktion »gui_mainwindow_document_view_draw«:
src/gui/mainwindow_sig.c:243:6: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o svg.o src/converters/svg.c
src/converters/svg.c: In Funktion »co_svg_create«:
src/converters/svg.c:99:3: Warnung: Format ist kein Zeichenkettenliteral, und keine Formatargumente [-Wformat-security]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o png.o src/converters/png.c
src/converters/png.c: In Funktion »co_png_export_to_file_from_handle«:
src/converters/png.c:39:3: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o pdf.o src/converters/pdf.c
src/converters/pdf.c: In Funktion »co_pdf_export_to_file_from_handle«:
src/converters/pdf.c:38:3: Warnung: Implizite Deklaration der Funktion »rsvg_handle_render_cairo« [-Wimplicit-function-declaration]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o wpi.o src/parsers/wpi.c
src/parsers/wpi.c: In Funktion »p_wpi_parse«:
src/parsers/wpi.c:101:9: Warnung: Der Rückgabewert von »fread«, der mit dem Attribut warn_unused_result deklariert wurde, wird ignoriert [-Wunused-result]
gcc -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags`   -c -o straight_lines.o src/optimizers/straight_lines.c
gcc `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --libs` -Wall -Os -DNDEBUG -DGTK_DISABLE_DEPRECATED=1 `pkg-config gtk+-3.0 glib-2.0 librsvg-2.0 cairo --cflags` main.o mainwindow.o mainwindow_sig.o svg.o png.o pdf.o wpi.o straight_lines.o -o InklingReader
mainwindow.o: In function `gui_init_mainwindow':
mainwindow.c:(.text+0x22): undefined reference to `gtk_init'
mainwindow.c:(.text+0x29): undefined reference to `gtk_window_new'
mainwindow.c:(.text+0x33): undefined reference to `gtk_menu_button_new'
mainwindow.c:(.text+0x3b): undefined reference to `gtk_menu_new'
[skipping more lines with undefined gtk references]
mainwindow_sig.c:(.text+0x439): undefined reference to `gtk_container_add'
mainwindow_sig.o: In function `gui_mainwindow_document_view_draw':
mainwindow_sig.c:(.text+0x48f): undefined reference to `gtk_widget_get_allocated_width'
mainwindow_sig.c:(.text+0x4cf): undefined reference to `cairo_translate'
mainwindow_sig.c:(.text+0x4e2): undefined reference to `cairo_scale'
mainwindow_sig.c:(.text+0x521): undefined reference to `rsvg_handle_new_from_data'
mainwindow_sig.c:(.text+0x541): undefined reference to `rsvg_handle_render_cairo'
mainwindow_sig.o: In function `gui_mainwindow_export_activated':
mainwindow_sig.c:(.text+0x302): undefined reference to `g_free'
svg.o: In function `co_svg_create':
svg.c:(.text+0x15): undefined reference to `g_slist_length'
svg.c:(.text+0x3c): undefined reference to `g_slist_length'
png.o: In function `co_png_export_to_file_from_handle':
png.c:(.text+0x20): undefined reference to `cairo_image_surface_create'
png.c:(.text+0x2b): undefined reference to `cairo_create'
png.c:(.text+0x3b): undefined reference to `rsvg_handle_render_cairo'
png.c:(.text+0x46): undefined reference to `cairo_surface_write_to_png'
png.c:(.text+0x52): undefined reference to `cairo_destroy'
png.c:(.text+0x5a): undefined reference to `cairo_surface_destroy'
png.o: In function `co_png_export_to_file':
png.c:(.text+0x8c): undefined reference to `rsvg_handle_new_from_data'
pdf.o: In function `co_pdf_export_to_file_from_handle':
pdf.c:(.text+0x18): undefined reference to `cairo_pdf_surface_create'
pdf.c:(.text+0x23): undefined reference to `cairo_create'
pdf.c:(.text+0x33): undefined reference to `rsvg_handle_render_cairo'
pdf.c:(.text+0x3b): undefined reference to `cairo_surface_show_page'
pdf.c:(.text+0x43): undefined reference to `cairo_surface_finish'
pdf.c:(.text+0x4b): undefined reference to `cairo_destroy'
pdf.c:(.text+0x53): undefined reference to `cairo_surface_destroy'
pdf.o: In function `co_pdf_export_to_file':
pdf.c:(.text+0x7d): undefined reference to `rsvg_handle_new_from_data'
wpi.o: In function `p_wpi_parse':
wpi.c:(.text+0x101): undefined reference to `g_base64_encode'
wpi.c:(.text+0x21e): undefined reference to `g_slist_prepend'
wpi.c:(.text+0x39d): undefined reference to `g_slist_prepend'
wpi.c:(.text+0x3ba): undefined reference to `g_slist_reverse'
collect2: ld gab 1 als Ende-Status zurück
make: *** [InklingReader] Fehler 1

I'm sorry for the german localization, but may be you can help me out and tell me what I'm doing wrong.
If you need more information, tell me.

Documentation and packaging

User guide

To make it easier to use the program a user guide would be quite useful.
@xuv: Would you be interested in helping out with this?

Developer documentation

I've taken better care of documenting the code to create a reference guide. I used doxygen to make a nice overview which can be viewed here: roelj.com/inklingreader.

Packaging

I experimented with debian packaging and I think I can provide a self-signed Debian package. I wonder if anyone has any experience with packaging..

Configuration file is written location dependent

When I open inklingreader on my linux system (LC_NUMERIC=de_DE.UTF-8) and save the config file, the paper size format is written with a comma as decimal point. This can't be read when opening the application again and sketches won't be displayed correctly. Maybe because the page size is recognized as zero.

I'll try to use the same setlocale code as used for the csv.c code in the repo.

Authors file

I want to make an AUTHORS file to give credits where they belong. The only problem is that I don't know how you want to be named in the file.

My proposal is
[Name] [e-mail address] for
[Contributions]

@su-v made the software run on Mac OS X and compilable with CLANG.
@MeraX added stroke pressure and a way to effectively remove spikes and clutter from the output.

Please let me know if you want to have your name and e-mail address in the AUTHORS file, and if so, give me your name and e-mail address :-).

collect2 error when compiling on ubuntu 14.04

I got this error:

isaac.marco@portatil51:~/git/inklingreader$ make
  CC       src/main.o
  CC       src/gui/mainwindow.o
src/gui/mainwindow.c: In function ‘gui_mainwindow_init’:
src/gui/mainwindow.c:149:20: warning: assignment makes pointer from integer without a cast [enabled by default]
   settings_popover = gtk_popover_new (settings_button);
                    ^
src/gui/mainwindow.c:150:18: warning: assignment makes pointer from integer without a cast [enabled by default]
   timing_popover = gtk_popover_new (timing_button);
                  ^
  CC       src/converters/svg.o
  CC       src/converters/png.o
  CC       src/converters/json.o
  CC       src/converters/pdf.o
  CC       src/converters/csv.o
  CC       src/parsers/wpi.o
  CC       src/high/conversion.o
  CC       src/datatypes/configuration.o
  CC       src/optimizers/point-reduction.o
  CC       src/usb/online-mode.o
  CCLD     inklingreader
src/gui/mainwindow.o: En la función `gui_mainwindow_init':
/home/isaac.marco/git/inklingreader/src/gui/mainwindow.c:137: referencia a `gtk_header_bar_set_has_subtitle' sin definir
/home/isaac.marco/git/inklingreader/src/gui/mainwindow.c:149: referencia a `gtk_popover_new' sin definir
/home/isaac.marco/git/inklingreader/src/gui/mainwindow.c:150: referencia a `gtk_popover_new' sin definir
/home/isaac.marco/git/inklingreader/src/gui/mainwindow.c:152: referencia a `gtk_menu_button_set_popover' sin definir
/home/isaac.marco/git/inklingreader/src/gui/mainwindow.c:153: referencia a `gtk_menu_button_set_popover' sin definir
collect2: error: ld returned 1 exit status
make: *** [inklingreader] Error 1

Crash on GUI launch

Have a crash at startup when launching ./inklingreader with latest version (@164a8f1bfbaa390a6579cb90dd7a32a701fc1871)

$ ./inklingreader
inklingreader: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed.
Abandon

Although it compiles without errors.

Idea: Filter disturbing skipes

I hope you're fine with me starting a new Issue for every new topic.
While making the sketches for the other issue, I realized that the Inkling creates a lot of spikes:
how it looks like after conversion to svg:
20
about how it looks on my paper (actually after cleaning it up an coloring using inkscape):
stroke_with2
Inspecting the spikes in Inkscape I figured out that they consists of singular points positioned far away the stroke.

You could measure the distance between adjacent points: If the distance from point 1 to point 2 or from 2 to 3 is much larger than the distance from 1 to 3 you should throw point 2 away. (maybe you have to include also the point before and after in such a filter)

Sadly I'm not an expert in C and I can't try out my ideas myself. But maybe if you add more and more features one day you produced enough code so that I can add something by modifying and recombining of what is already there.

timing data

Just to keep threads clean, I cut out the timing data question from #7
@xuv #7 (comment) :

Yet another maybe stupid question (and this bug report is turning into a huge thread), but is there "time" data in the WPI file in any way ? I mean, does the file has a record of some sort of "stroke speed" ?

@roelj #7 (comment) :

About timing data.. as far as I know this is not stored. There still is some data left that we don't know what it is or represents. But honestly, I don't think the data represents timestamps or anything related to the speed of drawing. The data is linear in the sense that whatever is written first with the pen, is written first in the file (therefore "playback" of strokes is possible).

I would suggest to investigate, weather the recorded data has a fixed frequency, e.g. 10 records per second. If this is the case we have some speed information. (Note: with my extension to stroke width I added a mechanism to skip records with same (x,y).)

Refresh on resize only

Thanks for this great piece of software. I got interested in it following @n8willis presentation of it at #LGM2014 last week (so you know ;) ).

So I've compiled it and when I open a new file, I have to resize the window to actually see it. If I load another file after that, a resize or a scroll has to be performed to see the new drawing.

Thanks again for this excellent work. If I can be of any help, please ask. Although, I'm not a C coder, I can send you some WPI files if you want to study them.

GUI file manager enhancements

Little things and ideas that could make the overall GUI experience with files a little better:

  • If the application could remember the location (folder) where the last file was opened from. So when the user tries to open a new file, the file manager shows the last folder that the user was in. Usually, we all keep our drawing in the same folder, if not in the Wacom receiver itself.
  • Same for saving files. If the gui could remember where it saved last.
  • Since it can save in multiple formats, for now, we just have to add the right extension to the file, which is great. But some (new) users will want to choose the format from a drop down menu with all the possibilities (svg, pdf, json,… (others?) )

This is, of course, just suggestions. The program is working great and I have no idea how much work this all requires. I write it down here just to keep track of ideas.

only svg output right now? and a gui bug

After solving the compiler problems, I played around with InklingReader and found two bugs:

$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.svg
$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.png
$ ./InklingReader -f ../SKETCH5.WPI -t ../s5.pdf

These commands always create a svg file regardless of the given extension.

When opening SKETCH5.WPI with the gui it looks like:
gui-bug
which is actually not what I draw. When I export this via the gui different file formats work, but they also only show these bars. And during the loading of the dialog window for opening and closing InklingReader uses a lot of my CPU.

Never the less converting wpi to svg on the command line works very well and I'm very happy.

Crash on opening a certain file

Just realized that inklingreader crashes when I open a certain file.
The file: http://xuv.be/static/inkling/SKETCH5.WPI

Here's what it throws:

*** glibc detected *** ./inklingreader: realloc(): invalid next size: 0x0a086000 ***
======= Backtrace: =========
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x70f01)[0xb6bf6f01]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(+0x766fd)[0xb6bfc6fd]
/lib/i386-linux-gnu/i686/cmov/libc.so.6(realloc+0xdd)[0xb6bfc9dd]
./inklingreader[0x804c81d]
======= Memory map: ========
08048000-08050000 r-xp 00000000 08:05 213083     /home/juego/inklingreader/inklingreader
08050000-08051000 rw-p 00008000 08:05 213083     /home/juego/inklingreader/inklingreader
09dff000-0a175000 rw-p 00000000 00:00 0          [heap]
aaef6000-aaef7000 ---p 00000000 00:00 0 
aaef7000-ab6f7000 rw-p 00000000 00:00 0 
abef8000-abef9000 ---p 00000000 00:00 0 
abef9000-ac6f9000 rw-p 00000000 00:00 0 
ac6f9000-ac6fa000 ---p 00000000 00:00 0 
ac6fa000-acefa000 rw-p 00000000 00:00 0 
ad6fb000-ad6fc000 ---p 00000000 00:00 0 
ad6fc000-adefc000 rw-p 00000000 00:00 0 
adefc000-adefd000 ---p 00000000 00:00 0 
adefd000-ae6fd000 rw-p 00000000 00:00 0 
ae6fd000-ae6fe000 ---p 00000000 00:00 0 
ae6fe000-aeefe000 rw-p 00000000 00:00 0 
aeefe000-aeeff000 ---p 00000000 00:00 0 
aeeff000-af6ff000 rw-p 00000000 00:00 0 
aff00000-aff26000 rw-p 00000000 00:00 0 
aff26000-b0000000 ---p 00000000 00:00 0 
b0060000-b006e000 r--p 00000000 08:03 360703     /usr/share/glib-2.0/schemas/gschemas.compiled
b0839000-b0855000 r-xp 00000000 08:03 811539     /lib/i386-linux-gnu/libgcc_s.so.1
b0855000-b0856000 rw-p 0001b000 08:03 811539     /lib/i386-linux-gnu/libgcc_s.so.1
b086f000-b0870000 r-xp 00000000 08:03 294952     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
b0870000-b0871000 r--p 00001000 08:03 294952     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
b0871000-b0872000 rw-p 00002000 08:03 294952     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-svg.so
b0872000-b1963000 r--p 00000000 08:03 985815     /usr/share/icons/hicolor/icon-theme.cache
b1963000-b607f000 r--p 00000000 08:03 961256     /usr/share/icons/gnome/icon-theme.cache
b607f000-b612f000 r--p 00000000 08:03 909463     /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
b612f000-b6151000 r--p 00000000 08:03 909377     /usr/share/fonts/truetype/liberation/LiberationSans-Bold.ttf
b6151000-b6174000 r--p 00000000 08:03 909380     /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf
b6174000-b6176000 r-xp 00000000 08:03 786585     /usr/lib/i386-linux-gnu/pango/1.6.0/modules/pango-basic-fc.so
b6176000-b6177000 r--p 00001000 08:03 786585     /usr/lib/i386-linux-gnu/pango/1.6.0/modules/pango-basic-fc.so
b6177000-b6178000 rw-p 00002000 08:03 786585     /usr/lib/i386-linux-gnu/pango/1.6.0/modules/pango-basic-fc.so
b6178000-b6179000 r--s 00000000 08:03 548924     /var/cache/fontconfig/c05880de57d1f5e948fdfacc138775d9-le32d4.cache-3
b6179000-b617f000 r--s 00000000 08:03 548922     /var/cache/fontconfig/945677eb7aeaf62f1d50efc3fb3ec7d8-le32d4.cache-3
b617f000-b6183000 r--s 00000000 08:03 548921     /var/cache/fontconfig/6eb3985aa4124903f6ff08ba781cd364-le32d4.cache-3
b6183000-b618a000 r--s 00000000 08:03 553082     /var/cache/fontconfig/6d41288fd70b0be22e8c3a91e032eec0-le32d4.cache-3
b618a000-b6195000 r--s 00000000 08:03 1076035    /var/cache/fontconfig/04aabc0a78ac019cf9454389977116d2-le32d4.cache-3
b6195000-b6196000 r--s 00000000 08:03 553081     /var/cache/fontconfig/4794a0821666d79190d59a36cb4f44b5-le32d4.cache-3
b6196000-b61b9000 r--s 00000000 08:03 548928     /var/cache/fontconfig/365b55f210c0a22e9a19e35191240f32-le32d4.cache-3
b61b9000-b61bb000 r--s 00000000 08:03 548915     /var/cache/fontconfig/c57959a16110560c8d0fcea73374aeeb-le32d4.cache-3
b61bb000-b61bf000 r--s 00000000 08:03 548932     /var/cache/fontconfig/3047814df9a2f067bd2d96a2b9c36e5a-le32d4.cache-3
b61bf000-b61c1000 r--s 00000000 08:03 553080     /var/cache/fontconfig/e49e89034d371f0f9de17aab02136486-le32d4.cache-3
b61c1000-b61c2000 r--s 00000000 08:03 549109     /var/cache/fontconfig/4b14b093aebc79c320de5e86ae1d3314-le32d4.cache-3
b61c2000-b61cf000 r--s 00000000 08:03 548917     /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-le32d4.cache-3
b61cf000-b6209000 r--s 00000000 08:05 4398938    /home/juego/.fontconfig/18f8e7f070d3cd4782326d90f2048dcb-le32d4.cache-3
b6209000-b620f000 r--p 00000000 08:03 1008269    /usr/share/locale/fr/LC_MESSAGES/gdk-pixbuf.mo
b620f000-b622e000 r--s 00000000 08:03 853280     /usr/share/mime/mime.cache
b622e000-b623e000 r-xp 00000000 08:03 770942     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/theming-engines/libunico.so
b623e000-b623f000 r--p 0000f000 08:03 770942     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/theming-engines/libunico.so
b623f000-b6240000 rw-p 00010000 08:03 770942     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/theming-engines/libunico.so
b6242000-b6249000 r--p 00000000 08:05 4417831    /home/juego/.config/dconf/user
b6249000-b624a000 r-xp 00000000 08:03 671801     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-cedilla.so
b624a000-b624b000 r--p 00000000 08:03 671801     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-cedilla.so
b624b000-b624c000 rw-p 00001000 08:03 671801     /usr/lib/i386-linux-gnu/gtk-3.0/3.0.0/immodules/im-cedilla.so
b624c000-b6252000 r--s 00000000 08:03 548914     /var/cache/fontconfig/3f7329c5293ffd510edef78f73874cfd-le32d4.cache-3
b6252000-b6259000 r--s 00000000 08:03 553078     /var/cache/fontconfig/83bf95040141907cd45bb53cf7c1c148-le32d4.cache-3
b6259000-b6261000 r--s 00000000 08:03 552802     /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le32d4.cache-3
b6261000-b6268000 r-xp 00000000 08:03 770658     /usr/lib/i386-linux-gnu/gio/modules/libdconfsettings.so
b6268000-b6269000 r--p 00006000 08:03 770658     /usr/lib/i386-linux-gnu/gio/modules/libdconfsettings.so
b6269000-b626a000 rw-p 00007000 08:03 770658     /usr/lib/i386-linux-gnu/gio/modules/libdconfsettings.so
b626a000-b6299000 r-xp 00000000 08:03 755939     /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
b6299000-b629a000 r--p 0002f000 08:03 755939     /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
b629a000-b629b000 rw-p 00030000 08:03 755939     /usr/lib/i386-linux-gnu/libbluray.so.1.1.0
b629b000-b629d000 r-xp 00000000 08:03 811280     /lib/i386-linux-gnu/i686/cmov/libutil-2.13.so
b629d000-b629e000 r--p 00001000 08:03 811280     /lib/i386-linux-gnu/i686/cmov/libutil-2.13.so
b629e000-b629f000 rw-p 00002000 08:03 811280     /lib/i386-linux-gnu/i686/cmov/libutil-2.13.so
b629f000-b62ad000 r-xp 00000000 08:03 811633     /lib/i386-linux-gnu/libudev.so.0.13.0
b62ad000-b62ae000 r--p 0000d000 08:03 811633     /lib/i386-linux-gnu/libudev.so.0.13.0
b62ae000-b62af000 rw-p 0000e000 08:03 811633     /lib/i386-linux-gnu/libudev.so.0.13.0
b62af000-b62f8000 r-xp 00000000 08:03 811540     /lib/i386-linux-gnu/libdbus-1.so.3.7.2
b62f8000-b62f9000 ---p 00049000 08:03 811540     /lib/i386-linux-gnu/libdbus-1.so.3.7.2
b62f9000-b62fa000 r--p 00049000 08:03 811540     /lib/i386-linux-gnu/libdbus-1.so.3.7.2
b62fa000-b62fb000 rw-p 0004a000 08:03 811540     /lib/i386-linux-gnu/libdbus-1.so.3.7.2
b62fb000-b62ff000 r-xp 00000000 08:03 770483     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
b62ff000-b6300000 r--p 00003000 08:03 770483     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
b6300000-b6301000 rw-p 00004000 08:03 770483     /usr/lib/i386-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so
b6301000-b6312000 r-xp 00000000 08:03 770662     /usr/lib/i386-linux-gnu/gio/modules/libgioremote-volume-monitor.so
b6312000-b6313000 r--p 00010000 08:03 770662     /usr/lib/i386-linux-gnu/gio/modules/libgioremote-volume-monitor.so
b6313000-b6314000 rw-p 00011000 08:03 770662     /usr/lib/i386-linux-gnu/gio/modules/libgioremote-volume-monitor.so
b6314000-b632b000 r-xp 00000000 08:03 770948     /usr/lib/i386-linux-gnu/gvfs/libgvfscommon.so
b632b000-b632c000 r--p 00016000 08:03 770948     /usr/lib/i386-linux-gnu/gvfs/libgvfscommon.so
b632c000-b632d000 rw-p 00017000 08:03 770948     /usr/lib/i386-linux-gnu/gvfs/libgvfscommon.so
b632d000-b6358000 r-xp 00000000 08:03 770663     /usr/lib/i386-linux-gnu/gio/modules/libgvfsdbus.so
b6358000-b6359000 r--p 0002a000 08:03 770663     /usr/lib/i386-linux-gnu/gio/modules/libgvfsdbus.so
b6359000-b635a000 rw-p 0002b000 08:03 770663     /usr/lib/i386-linux-gnu/gio/modules/libgvfsdbus.so
b635a000-b6373000 r--p 00000000 08:03 1008285    /usr/share/locale/fr/LC_MESSAGES/glib20.mo
b6373000-b6376000 r--p 00000000 08:03 1008240    /usr/share/locale/fr/LC_MESSAGES/atk10.mo
b6376000-b63a4000 r--p 00000000 08:03 147669     /usr/share/locale/fr/LC_MESSAGES/gtk30-properties.mo
b63a4000-b63c7000 r--p 00000000 08:03 1008319    /usr/share/locale/fr/LC_MESSAGES/libc.mo
b63c7000-b653e000 r--p 00000000 08:03 804999     /usr/lib/locale/locale-archive
b653e000-b6548000 r-xp 00000000 08:03 811286     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b6548000-b6549000 r--p 00009000 08:03 811286     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b6549000-b654a000 rw-p 0000a000 08:03 811286     /lib/i386-linux-gnu/i686/cmov/libnss_files-2.13.so
b654a000-b6553000 r-xp 00000000 08:03 811285     /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b6553000-b6554000 r--p 00008000 08:03 811285     /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b6554000-b6555000 rw-p 00009000 08:03 811285     /lib/i386-linux-gnu/i686/cmov/libnss_nis-2.13.so
b6555000-b6568000 r-xp 00000000 08:03 811515     /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b6568000-b6569000 r--p 00012000 08:03 811515     /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b6569000-b656a000 rw-p 00013000 08:03 811515     /lib/i386-linux-gnu/i686/cmov/libnsl-2.13.so
b656a000-b656c000 rw-p 00000000 00:00 0 
b656c000-b6572000 r-xp 00000000 08:03 811281     /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b6572000-b6573000 r--p 00005000 08:03 811281     /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b6573000-b6574000 rw-p 00006000 08:03 811281     /lib/i386-linux-gnu/i686/cmov/libnss_compat-2.13.so
b6574000-b6577000 rw-p 00000000 00:00 0 
b6577000-b657c000 r-xp 00000000 08:03 755860     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b657c000-b657d000 rw-p 00004000 08:03 755860     /usr/lib/i386-linux-gnu/libXdmcp.so.6.0.0
b657d000-b657f000 r-xp 00000000 08:03 755849     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b657f000-b6580000 rw-p 00001000 08:03 755849     /usr/lib/i386-linux-gnu/libXau.so.6.0.0
b6580000-b65a5000 r-xp 00000000 08:03 811559     /lib/i386-linux-gnu/liblzma.so.5.0.0
b65a5000-b65a6000 r--p 00024000 08:03 811559     /lib/i386-linux-gnu/liblzma.so.5.0.0
b65a6000-b65a7000 rw-p 00025000 08:03 811559     /lib/i386-linux-gnu/liblzma.so.5.0.0
b65a7000-b65a8000 rw-p 00000000 00:00 0 
b65a8000-b65cd000 r-xp 00000000 08:03 811213     /lib/i386-linux-gnu/libexpat.so.1.6.0
b65cd000-b65cf000 r--p 00025000 08:03 811213     /lib/i386-linux-gnu/libexpat.so.1.6.0
b65cf000-b65d0000 rw-p 00027000 08:03 811213     /lib/i386-linux-gnu/libexpat.so.1.6.0
b65d0000-b65d2000 r-xp 00000000 08:03 811497     /lib/i386-linux-gnu/i686/cmov/libdl-2.13.so
b65d2000-b65d3000 r--p 00001000 08:03 811497     /lib/i386-linux-gnu/i686/cmov/libdl-2.13.so
b65d3000-b65d4000 rw-p 00002000 08:03 811497     /lib/i386-linux-gnu/i686/cmov/libdl-2.13.so
b65d4000-b65dd000 r-xp 00000000 08:03 755604     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b65dd000-b65de000 rw-p 00008000 08:03 755604     /usr/lib/i386-linux-gnu/libXrender.so.1.3.0
b65de000-b65ff000 r-xp 00000000 08:03 755983     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b65ff000-b6600000 r--p 00020000 08:03 755983     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b6600000-b6601000 rw-p 00021000 08:03 755983     /usr/lib/i386-linux-gnu/libxcb.so.1.1.0
b6601000-b6602000 rw-p 00000000 00:00 0 
b6602000-b660b000 r-xp 00000000 08:03 755594     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b660b000-b660c000 r--p 00008000 08:03 755594     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b660c000-b660d000 rw-p 00009000 08:03 755594     /usr/lib/i386-linux-gnu/libxcb-render.so.0.0.0
b660d000-b660f000 r-xp 00000000 08:03 755598     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b660f000-b6610000 r--p 00001000 08:03 755598     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b6610000-b6611000 rw-p 00002000 08:03 755598     /usr/lib/i386-linux-gnu/libxcb-shm.so.0.0.0
b6611000-b66a4000 r-xp 00000000 08:03 754304     /usr/lib/i386-linux-gnu/libpixman-1.so.0.26.0
b66a4000-b66a8000 rw-p 00093000 08:03 754304     /usr/lib/i386-linux-gnu/libpixman-1.so.0.26.0
b66a8000-b66e5000 r-xp 00000000 08:03 811601     /lib/i386-linux-gnu/libpcre.so.3.13.1
b66e5000-b66e6000 rw-p 0003c000 08:03 811601     /lib/i386-linux-gnu/libpcre.so.3.13.1
b66e6000-b66ee000 r-xp 00000000 08:03 756039     /usr/lib/i386-linux-gnu/libffi.so.5.0.10
b66ee000-b66ef000 rw-p 00008000 08:03 756039     /usr/lib/i386-linux-gnu/libffi.so.5.0.10
b66ef000-b66f0000 rw-p 00000000 00:00 0 
b66f0000-b66f1000 r-xp 00000000 08:03 756203     /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.3200.4
b66f1000-b66f2000 r--p 00000000 08:03 756203     /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.3200.4
b66f2000-b66f3000 rw-p 00001000 08:03 756203     /usr/lib/i386-linux-gnu/libgthread-2.0.so.0.3200.4
b66f3000-b671b000 r-xp 00000000 08:03 811603     /lib/i386-linux-gnu/libpng12.so.0.49.0
b671b000-b671c000 r--p 00027000 08:03 811603     /lib/i386-linux-gnu/libpng12.so.0.49.0
b671c000-b671d000 rw-p 00028000 08:03 811603     /lib/i386-linux-gnu/libpng12.so.0.49.0
b671d000-b672d000 r-xp 00000000 08:03 811282     /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b672d000-b672e000 r--p 00010000 08:03 811282     /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b672e000-b672f000 rw-p 00011000 08:03 811282     /lib/i386-linux-gnu/i686/cmov/libresolv-2.13.so
b672f000-b6731000 rw-p 00000000 00:00 0 
b6731000-b674f000 r-xp 00000000 08:03 811618     /lib/i386-linux-gnu/libselinux.so.1
b674f000-b6750000 r--p 0001d000 08:03 811618     /lib/i386-linux-gnu/libselinux.so.1
b6750000-b6751000 rw-p 0001e000 08:03 811618     /lib/i386-linux-gnu/libselinux.so.1
b6751000-b6768000 r-xp 00000000 08:03 811648     /lib/i386-linux-gnu/libz.so.1.2.7
b6768000-b6769000 r--p 00016000 08:03 811648     /lib/i386-linux-gnu/libz.so.1.2.7
b6769000-b676a000 rw-p 00017000 08:03 811648     /lib/i386-linux-gnu/libz.so.1.2.7
b676a000-b676b000 rw-p 00000000 00:00 0 
b676b000-b68b8000 r-xp 00000000 08:03 754064     /usr/lib/i386-linux-gnu/libxml2.so.2.8.0
b68b8000-b68b9000 ---p 0014d000 08:03 754064     /usr/lib/i386-linux-gnu/libxml2.so.2.8.0
b68b9000-b68bd000 r--p 0014d000 08:03 754064     /usr/lib/i386-linux-gnu/libxml2.so.2.8.0
b68bd000-b68be000 rw-p 00151000 08:03 754064     /usr/lib/i386-linux-gnu/libxml2.so.2.8.0
b68be000-b68bf000 rw-p 00000000 00:00 0 
b68bf000-b68f8000 r-xp 00000000 08:03 755964     /usr/lib/i386-linux-gnu/libcroco-0.6.so.3.0.1Abandon

OS X malloc.h vs. stdlib.h

Really nice programm!

For compiling InklingReader 0.6 with Xcode 5.1.1 (Command Line Tools) under OS X 10.9.3 without errors I had to make one little change in mainwindow.c:

replace malloc.h with standard C header stdlib.h
// #include <malloc.h>

include <stdlib.h>

I think XQuartz (X11) and the dylibs (gtk+-3.0 glib-2.0 librsvg-2.0 cairo) are not part of a new OS X installation so they might have to be installed first, however I already had them so it worked perfectly for my first tests and it's definitely already better than Sketch Manager.

Gtk-CRITICAL when opening a WPI file

Copying from discussion under issue #20

When loadling a file (any already provided test file will do), I get these errors in the console:

(inklingreader:13381): Gtk-CRITICAL **: gtk_widget_set_size_request: assertion `width >= -1' failed
(inklingreader:13381): Gtk-WARNING **: drawing failure for widget `GtkDrawingArea': invalid matrix (not invertible)

Although the program seems to work normally, the drawing is displayed correctly.

Use viewBox in SVG exports

SVG documents with page size in real units should use a viewBox attribute to define the scale, e.g.

   width="744.09448"
   height="1052.3622"
   viewBox="0 0 744.09448 1052.3622"

or

   width="210mm"
   height="297mm"
   viewBox="0 0 744.09448 1052.3622"

or

   width="210mm"
   height="297mm"
   viewBox="0 0 210 297"

The last one redefines the SVG user unit for the document as 1mm, the other two match an A4 page based on (Inkscape's current) 90dpi internal resolution for the 'px' SVG user unit.

While current stable Inkscape never adds this attribute itself to new documents, this has changed in inkscape trunk (for upcoming major release 0.91), and should probably be used in the SVG files exported by inklingreader too (otherwise the documents might render differently in different SVG viewers).

See also:
http://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute

… and for example two recent discussions on the inkscape-devel mailing list (since improved viewBox support is part of the unit refactoring which landed in Inkscape trunk last year):
http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/43281
http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/43430

Library for Python or Guile

I believe some of you are interested in hacking further on the code but would rather do so in a different language than C.

I could make the important functionality available to other languages by writing a wrapper for Python or Guile. I'm actually already familiar with writing libraries for Guile (the GNU extension language).

Would anyone find this useful? If so, which language would you prefer (please check out Guile because it's made for this purpose). I think (but I've never tried) this is also possible for Python.

Drawing for screenshot

Could someone make a cool drawing to use in the screenshot displayed on the Github page?

Running in Docker-Container

Hi @roelj,

Thanks for your tool – since the original one by Wacom regularly breaks my Illustrator and even does not work at all, I'm glad to have an alternative to get my Sketches from Inkling to SVGs and further.

I like the idea of how most Mac-Applications work very much: a file / folder and some little config files, so programs are removable very easy – and even installable very fast.
On my systems (Linux and MacOS) I regularly try to avoid to mess the system with programs I do not use every day.

Since Docker gives us the ability to containerise apps, I think it is a great way to prevent messing the system up – and built a Docker image which is at least simple: https://hub.docker.com/r/macwinnie/inklingreader/

Probably this could be an easy way to provide the tool to other users. If you would like to link your repository to the Docker image, so it will be rebuilt every time you push a change / improvement, let's get in contact =)

Cheers,
Martin

test files (WPI)

To ease testing this new tool on other platforms, it would be helpful to have a couple of test files available (original WPI, and all supported export formats (SVG, PNG, PDF)).

(Background of this request: personally, I don't own a Wacom Inkling - my interest is mostly driven by Inkscape users asking for available solutions to edit Inkling files in Inkscape. Possibly inklingreader (CLI) could be used via input extension (similar to how input of PS/EPS (via ps2pdf) currently is implemented, or other file formats supported via UniConvertor 1.1.5), so that for editing, WPI files could be opened as SVG files directly from Inkscape (if inklingreader is installed and found in $PATH)).

JSON format

I'd like to use a separate issue for discussing the JSON format.


@MeraX wrote:
I agree, a simple conversion from WPI to some common fileformat like JSON would be handy to further investigate on the data with a programming language of your choice. (e.g. I would play around with it in a python environment)

Personally I prefer JSON and as far as I understand inklinkreader and the WPI format, JSON fits well on the data.

maybe something simple like

{
  "$layer_ID": {
    "$StrokeID": {
      "$pointID": {
        "x": "$x",
        "y": "$y",
        "pressure": "$p",
        "tilt-x": "$tx",
        "tilt-y": "$ty"
      }
    }
  }
}

with x and y already converted to a useful unit like mm. Is there additional information, that could also be interesting to investigate on?


Do you want human-readable output (whitespacing) or only machine-readable output (without whitespacing), or both?

I expect to have the JSON output converter to be in the repo tonight. I assume whitespacing should be enabled. This isn't a big deal though, maybe we can even have both at some point.

CLANG support

I see @su-v has made the code compatible with CLANG. As far as I can see it doesn't conflict with the recent changes. Could you (@su-v) send a pull request so I can easily merge your changes into here?

Support XDG basedir spec for config file

AFAIU the currently supported location of the config file is $HOME/.inklingreaderrc.

Would it make sense to you to support the user's definition of $XDG_CONFIG_HOME instead, based on the XDG Base Directory Specification?

From the spec:

  • There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.

and:

  • $XDG_CONFIG_HOME defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

Crash when using custom colors

Lastest inklinkgreader crashes on OS X if either a config file is present, or colors (for background, or for the pen) are specified on the command line.

$ gdb inklingreader
GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ................... done

(gdb) r --colors="#000000,#ff0000,#0000ff,#00ff00" --file ./tree.WPI --to ./tree-colors.svg
Starting program: /Users/su_v/.local/bin/inklingreader --colors="#000000,#ff0000,#0000ff,#00ff00" --file ./tree.WPI --to ./tree-colors.svg
Reading symbols for shared libraries ++++++++++++++++++.......................................................................................................................................................... done
inklingreader(29096) malloc: *** error for object 0x10101c928: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x00007fff88d0782a in __kill ()
(gdb) bt full
#0  0x00007fff88d0782a in __kill ()
No symbol table info available.
#1  0x00007fff8dafaa9c in abort ()
No symbol table info available.
#2  0x00007fff8db5984c in free ()
No symbol table info available.
#3  0x0000000100006ae9 in dt_configuration_cleanup (config=0x1000096d0) at src/datatypes/configuration.c:86
    a = 1
#4  0x0000000100001c60 in cleanup_configuration () at src/main.c:102
No locals.
#5  0x00007fff8dafa7d0 in __cxa_finalize ()
No symbol table info available.
#6  0x00007fff8dafa652 in exit ()
No symbol table info available.
#7  0x000000010000165b in start ()
No symbol table info available.
(gdb) 

Sample inklingreaderrc file which triggers the same type of crash:

background = #efefef
colors = #729fcf,#999999,#ff8080,#cccccc
pressure-factor = 1.0

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.