Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: kmx/mirror-im
base: 543dac1f81
...
head fork: kmx/mirror-im
compare: 0e6547e820
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
View
7 html/en/history.html
@@ -110,6 +110,13 @@ <h3 dir="ltr">
style="color: #000000">
<span class="hist_fixed">Fixed:</span> support for GPS Exif tags in JPEG
format.</span></span></font></li>
+ <li dir="ltr">
+ <span style="color: #008000">
+ <span
+ style="color: #000000">
+<font SIZE="3">
+ <span class="hist_fixed">Fixed:</span> invalid ymin processing in
+ <strong>imProcessInsert</strong>.</font></span></span></li>
</ul>
</font>
<h3 dir="ltr">
View
31 html/examples/view.wlua
@@ -4,39 +4,16 @@ require"cdluaim"
require"iuplua"
require"iupluacd"
-function PrintError(func, err)
- local msg = {}
- msg[im.ERR_OPEN] = "Error Opening File."
- msg[im.ERR_MEM] = "Insuficient memory."
- msg[im.ERR_ACCESS] = "Error Accessing File."
- msg[im.ERR_DATA] = "Image type not Suported."
- msg[im.ERR_FORMAT] = "Invalid Format."
- msg[im.ERR_COMPRESS] = "Invalid or unsupported compression."
-
- if msg[err] then
- print(func..": "..msg[err])
- else
- print("Unknown Error.")
- end
-end
function LoadImage(file_name)
- local image
- local ifile, err = im.FileOpen(file_name)
- if not ifile then
- PrintError("open", err)
- return
- end
-
-- load the first image in the file.
-- force the image to be converted to a bitmap
- image, err = ifile:LoadBitmap()
+ local image, err = im.FileImageLoadBitmap(file_name)
+
if not image then
- PrintError("load", err)
- return
+ error(im.ErrorStr(err))
end
-
- ifile:Close()
+
return image
end
View
1  html/examples/view_image.wlua
@@ -4,7 +4,6 @@ require"cdluaim"
require"iuplua"
require"iupluacd"
-iup.key_open()
function View_Image(image, title)
ret = false
View
23 src/process/im_resize.cpp
@@ -316,7 +316,7 @@ void imProcessInsert(const imImage* src_image, const imImage* rgn_image, imImage
int dst_size2 = src_image->line_size - (rgn_image->line_size + dst_size1);
int dst_offset2 = dst_size1+rgn_image->line_size;
int ymax = ymin+rgn_image->height-1;
- int rgn_line_size = rgn_image->line_size;
+ int rgn_size, rgn_line_size = rgn_image->line_size;
int src_line_size = src_image->line_size;
int dst_line_size = dst_image->line_size;
int src_depth = src_image->has_alpha? src_image->depth+1: src_image->depth;
@@ -324,9 +324,11 @@ void imProcessInsert(const imImage* src_image, const imImage* rgn_image, imImage
if (dst_size2 < 0)
{
dst_size2 = 0;
- rgn_line_size = src_line_size - dst_size1;
+ rgn_size = src_line_size - dst_size1;
dst_offset2 = dst_size1 + rgn_line_size;
}
+ else
+ rgn_size = rgn_line_size;
if (ymax > src_image->height-1)
ymax = src_image->height-1;
@@ -344,18 +346,25 @@ void imProcessInsert(const imImage* src_image, const imImage* rgn_image, imImage
{
if (y < ymin || y > ymax)
{
- memcpy(dst_map + y*dst_line_size, src_map + y*src_line_size, src_line_size);
+ if (dst_map != src_map) // avoid in-place processing
+ memcpy(dst_map + y*dst_line_size, src_map + y*src_line_size, src_line_size);
}
else
{
if (dst_size1)
- memcpy(dst_map + y*dst_line_size, src_map + y*src_line_size, dst_size1);
+ {
+ if (dst_map != src_map) // avoid in-place processing
+ memcpy(dst_map + y*dst_line_size, src_map + y*src_line_size, dst_size1);
+ }
- memcpy(dst_map + y*dst_line_size + dst_size1, rgn_map + y*rgn_line_size, rgn_line_size);
+ memcpy(dst_map + y*dst_line_size + dst_size1, rgn_map + (y-ymin)*rgn_line_size, rgn_size);
if (dst_size2)
- memcpy(dst_map + y*dst_line_size + dst_offset2,
- src_map + y*src_line_size + dst_offset2, dst_size2);
+ {
+ if (dst_map != src_map) // avoid in-place processing
+ memcpy(dst_map + y*dst_line_size + dst_offset2,
+ src_map + y*src_line_size + dst_offset2, dst_size2);
+ }
}
}
}

No commit comments for this range

Something went wrong with that request. Please try again.