I suggest you ...

ImageResizer.Plugins.Watermark Bug

High concurrent request image with a watermark arise blocking。I guess it's a bug.

ImageResizer.Plugins.Watermark.ImageLayer.cs code:

public override void RenderTo(Resizing.ImageState s) {
...
lock (img) { //Only one reader from the cached bitmap at a time.
...
why used lock? Replace it with below code, are you ok?
using (img = img.Clone<Bitmap>()) { // Clone it's watermark image replace lock method.
...
}

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    wangyunpeng shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...
      • wangyunpeng commented  ·   ·  Flag as inappropriate

        uses a process-wide lock,I know. My site in windows, I/O 4M/sec with System process and lock code ,without lock code I/O 14M/sec.I think lock code with w3wp's user execute ,not process's user execute. How solve the problem , delete lock(img) are you ok?

      • AdminLilith River (Owner, Image Resizing Module) commented  ·   ·  Flag as inappropriate

        System.Drawing uses a process-wide lock. Duplicating the bitmap doesn't fix that. Profiling tools may show the lock differently. Do you measure an overall increase in throughput when applying large watermarks? What about peak RAM utilization?

      Feedback and Knowledge Base