Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
6af02c88
Commit
6af02c88
authored
Apr 06, 2013
by
Davis King
Browse files
Fixed a bug in save_dng() that happened sometimes when saving
images with unsigned char pixels.
parent
24757e21
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
dlib/image_saver/image_saver.h
dlib/image_saver/image_saver.h
+2
-1
dlib/test/image.cpp
dlib/test/image.cpp
+3
-3
No files found.
dlib/image_saver/image_saver.h
View file @
6af02c88
...
@@ -325,7 +325,8 @@ namespace dlib
...
@@ -325,7 +325,8 @@ namespace dlib
{
{
unsigned
char
cur
;
unsigned
char
cur
;
assign_pixel
(
cur
,
image
[
r
][
c
]);
assign_pixel
(
cur
,
image
[
r
][
c
]);
eem
.
encode
(
cur
-
predictor_grayscale
(
image
,
r
,
c
));
cur
-=
predictor_grayscale
(
image
,
r
,
c
);
eem
.
encode
(
cur
);
}
}
}
}
// write out the magic byte to mark the end of the data
// write out the magic byte to mark the end of the data
...
...
dlib/test/image.cpp
View file @
6af02c88
...
@@ -488,7 +488,7 @@ namespace
...
@@ -488,7 +488,7 @@ namespace
{
{
for
(
long
c
=
0
;
c
<
15
;
++
c
)
for
(
long
c
=
0
;
c
<
15
;
++
c
)
{
{
img
[
r
][
c
]
=
static_cast
<
unsigned
char
>
(
r
*
14
+
c
);
img
[
r
][
c
]
=
static_cast
<
unsigned
char
>
(
r
*
14
+
c
*
111
);
}
}
}
}
...
@@ -514,7 +514,7 @@ namespace
...
@@ -514,7 +514,7 @@ namespace
{
{
for
(
long
c
=
0
;
c
<
15
;
++
c
)
for
(
long
c
=
0
;
c
<
15
;
++
c
)
{
{
DLIB_TEST
(
img
[
r
][
c
]
==
r
*
14
+
c
);
DLIB_TEST
(
img
[
r
][
c
]
==
static_cast
<
unsigned
char
>
(
r
*
14
+
c
*
111
)
);
}
}
}
}
...
@@ -532,7 +532,7 @@ namespace
...
@@ -532,7 +532,7 @@ namespace
{
{
for
(
long
c
=
0
;
c
<
15
;
++
c
)
for
(
long
c
=
0
;
c
<
15
;
++
c
)
{
{
DLIB_TEST
(
img
[
r
][
c
]
==
r
*
14
+
c
);
DLIB_TEST
(
img
[
r
][
c
]
==
static_cast
<
unsigned
char
>
(
r
*
14
+
c
*
111
)
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment