Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
18e70f3
upload v1.14.0
JorjMcKie Nov 9, 2018
3f88440
update documentation to v1.14.0
JorjMcKie Nov 9, 2018
be4bf3a
.travis.yml: try xz archive
JorjMcKie Nov 9, 2018
705497f
Update .travis.yml
JorjMcKie Nov 9, 2018
c767c36
try fix mupdf download 1
JorjMcKie Nov 10, 2018
0ab2625
try another mupdf download
JorjMcKie Nov 10, 2018
c30ecf9
try alternative download
JorjMcKie Nov 10, 2018
1e48610
Update .travis.yml
JorjMcKie Nov 11, 2018
48324bf
Update .travis.yml
JorjMcKie Nov 11, 2018
3642f6a
next try
JorjMcKie Nov 11, 2018
b9b1658
Update .travis.yml
JorjMcKie Nov 11, 2018
d983254
yet another try
JorjMcKie Nov 11, 2018
48ad3c8
Update .travis.yml
JorjMcKie Nov 11, 2018
a133a59
Update .travis.yml
JorjMcKie Nov 11, 2018
34cc715
Update .travis.yml
JorjMcKie Nov 12, 2018
23ef882
Merge branch 'master' of https://github.com/JorjMcKie/py-mupdf
JorjMcKie Nov 12, 2018
01b8c4b
Update .travis.yml
JorjMcKie Nov 12, 2018
989c6d9
avoid use of FLT_EPSILON
JorjMcKie Nov 12, 2018
6429fb9
try tar.gz after re-compressing
JorjMcKie Nov 12, 2018
5732662
Update .travis.yml
JorjMcKie Nov 12, 2018
83d1e70
Update .travis.yml
JorjMcKie Nov 12, 2018
d9c84de
Update .travis.yml
JorjMcKie Nov 12, 2018
12f5724
apply corrections
JorjMcKie Nov 13, 2018
faa1b9d
Update .travis.yml
JorjMcKie Nov 13, 2018
c3c7dde
.travis.yml: gbu99 in linux only
JorjMcKie Nov 13, 2018
c9294ff
upload v1.14.0 docu and corrected pdf-device.c (MuPDF)
JorjMcKie Nov 14, 2018
5939401
try redirection of stderr & stdout
JorjMcKie Nov 15, 2018
5be2eef
redirecting stderr of MuPDF
JorjMcKie Nov 16, 2018
f2fbee4
Merge branch 'master' into master
JorjMcKie Nov 16, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
avoid use of FLT_EPSILON
  • Loading branch information
JorjMcKie committed Nov 12, 2018
commit 989c6d9660b85c4d055ef97ebaac02696ce04dc2
3 changes: 2 additions & 1 deletion fitz/fitz.i
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

#define SWIG_FILE_WITH_INIT
#define SWIG_PYTHON_2_UNICODE
#define JM_EPS 1E-5

// memory allocation macros
#define JM_MEMORY 1
Expand Down Expand Up @@ -6011,7 +6012,7 @@ struct Tools
fz_matrix src = JM_matrix_from_py(matrix);
float a = src.a;
float det = a * src.d - src.b * src.c;
if (det < -FLT_EPSILON || det > FLT_EPSILON)
if (det < -JM_EPS || det > JM_EPS)
{
fz_matrix dst;
float rdet = 1 / det;
Expand Down
4 changes: 2 additions & 2 deletions fitz/fitz.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ class _object:

VersionFitz = "1.14.0"
VersionBind = "1.14.0"
VersionDate = "2018-11-09 17:02:08"
version = (VersionBind, VersionFitz, "20181109170208")
VersionDate = "2018-11-12 04:19:55"
version = (VersionBind, VersionFitz, "20181112041955")


class Matrix():
Expand Down
17 changes: 9 additions & 8 deletions fitz/fitz_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3036,6 +3036,7 @@ static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};

#define SWIG_FILE_WITH_INIT
#define SWIG_PYTHON_2_UNICODE
#define JM_EPS 1E-5

// memory allocation macros
#define JM_MEMORY 1
Expand Down Expand Up @@ -3104,22 +3105,22 @@ struct DeviceWrapper {
int JM_is_valid_quad(fz_quad q)
{
fz_point b = fz_normalize_vector(fz_make_point(q.ur.x - q.ul.x, q.ur.y - q.ul.y));
if ((fabs(b.x) + fabs(b.y)) <= FLT_EPSILON) return 0; // empty quad!
if ((fabs(b.x) + fabs(b.y)) <= JM_EPS) return 0; // empty quad!

fz_point c = fz_normalize_vector(fz_make_point(q.ll.x - q.ul.x, q.ll.y - q.ul.y));
if ((fabs(c.x) + fabs(c.y)) <= FLT_EPSILON) return 0; // empty quad!
if ((fabs(c.x) + fabs(c.y)) <= JM_EPS) return 0; // empty quad!

if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at UL != 90 deg

b = fz_normalize_vector(fz_make_point(q.ur.x - q.lr.x, q.ur.y - q.lr.y));
c = fz_normalize_vector(fz_make_point(q.ll.x - q.lr.x, q.ll.y - q.lr.y));
if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at LR != 90 deg

b = fz_normalize_vector(fz_make_point(q.ul.x - q.ll.x, q.ul.y - q.ll.y));
c = fz_normalize_vector(fz_make_point(q.lr.x - q.ll.x, q.lr.y - q.ll.y));
if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at LL != 90 deg
return 1;
}
Expand Down Expand Up @@ -7611,8 +7612,8 @@ fz_rect JM_char_bbox(fz_stext_line *line, fz_stext_char *ch)
fz_rect r = fz_rect_from_quad(ch->quad);
if (!fz_is_empty_rect(r)) return r;
// we need to correct erroneous font!
if ((r.y1 - r.y0) <= FLT_EPSILON) r.y0 = r.y1 - ch->size;
if ((r.x1 - r.x0) <= FLT_EPSILON) r.x0 = r.x1 - ch->size;
if ((r.y1 - r.y0) <= JM_EPS) r.y0 = r.y1 - ch->size;
if ((r.x1 - r.x0) <= JM_EPS) r.x0 = r.x1 - ch->size;
return r;
}

Expand Down Expand Up @@ -13337,7 +13338,7 @@ SWIGINTERN PyObject *Tools_invert_matrix(struct Tools *self,PyObject *matrix){
fz_matrix src = JM_matrix_from_py(matrix);
float a = src.a;
float det = a * src.d - src.b * src.c;
if (det < -FLT_EPSILON || det > FLT_EPSILON)
if (det < -JM_EPS || det > JM_EPS)
{
fz_matrix dst;
float rdet = 1 / det;
Expand Down
10 changes: 5 additions & 5 deletions fitz/helper-geo-c.i
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
int JM_is_valid_quad(fz_quad q)
{
fz_point b = fz_normalize_vector(fz_make_point(q.ur.x - q.ul.x, q.ur.y - q.ul.y));
if ((fabs(b.x) + fabs(b.y)) <= FLT_EPSILON) return 0; // empty quad!
if ((fabs(b.x) + fabs(b.y)) <= JM_EPS) return 0; // empty quad!

fz_point c = fz_normalize_vector(fz_make_point(q.ll.x - q.ul.x, q.ll.y - q.ul.y));
if ((fabs(c.x) + fabs(c.y)) <= FLT_EPSILON) return 0; // empty quad!
if ((fabs(c.x) + fabs(c.y)) <= JM_EPS) return 0; // empty quad!

if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at UL != 90 deg

b = fz_normalize_vector(fz_make_point(q.ur.x - q.lr.x, q.ur.y - q.lr.y));
c = fz_normalize_vector(fz_make_point(q.ll.x - q.lr.x, q.ll.y - q.lr.y));
if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at LR != 90 deg

b = fz_normalize_vector(fz_make_point(q.ul.x - q.ll.x, q.ul.y - q.ll.y));
c = fz_normalize_vector(fz_make_point(q.lr.x - q.ll.x, q.lr.y - q.ll.y));
if (fabs(b.x * c.x + b.y * c.y) > FLT_EPSILON)
if (fabs(b.x * c.x + b.y * c.y) > JM_EPS)
return 0; // angle at LL != 90 deg
return 1;
}
Expand Down
4 changes: 2 additions & 2 deletions fitz/helper-stext.i
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ fz_rect JM_char_bbox(fz_stext_line *line, fz_stext_char *ch)
fz_rect r = fz_rect_from_quad(ch->quad);
if (!fz_is_empty_rect(r)) return r;
// we need to correct erroneous font!
if ((r.y1 - r.y0) <= FLT_EPSILON) r.y0 = r.y1 - ch->size;
if ((r.x1 - r.x0) <= FLT_EPSILON) r.x0 = r.x1 - ch->size;
if ((r.y1 - r.y0) <= JM_EPS) r.y0 = r.y1 - ch->size;
if ((r.x1 - r.x0) <= JM_EPS) r.x0 = r.x1 - ch->size;
return r;
}

Expand Down
4 changes: 2 additions & 2 deletions fitz/version.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%pythoncode %{
VersionFitz = "1.14.0"
VersionBind = "1.14.0"
VersionDate = "2018-11-09 17:02:08"
version = (VersionBind, VersionFitz, "20181109170208")
VersionDate = "2018-11-12 04:19:55"
version = (VersionBind, VersionFitz, "20181112041955")
%}