• Resolved Fahrenhe1t

    (@fahrenhe1t)


    Hi, I installed SLB and verified it works when linking to typical .jpg or .gif files. However, I’m trying to include a capture from a webcam, which doesn’t have a traditional extension. The URL to grab the photo is like this:
    http://camera/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&ver=”

    Running that URL or embedding in a page fetches a .jpg file. However, SLB is not engaged, and it opens the image in the full screen browser, not within a lightbox. Is it possible to add a class to the <a href> or <img> tag to force it to load in a lightbox? Thanks!

    https://ww.wp.xz.cn/plugins/simple-lightbox/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, support for nonstandard image URIs can be added using the slb_content_handlers_image_match filter.

    See this previous discussion on this topic for more details, including a sample plugin you can use as a starting point.

    Thread Starter Fahrenhe1t

    (@fahrenhe1t)

    Cool, looks like this will provide a solution. I’m wondering about the URI format though, is this a regular expression? I’m not exactly sure the formatting to match the URL above. Thanks for your response!

    Plugin Author Archetyped

    (@archetyped)

    The sample plugin uses regular expressions, but you actually can use any methodology you want to evaluate the URI since the handler function is simply passed the raw URI.

    Thread Starter Fahrenhe1t

    (@fahrenhe1t)

    Regular Expressions are intense, but I think I found a lazy one that works. My URL has “CGIProxy.fcgi” in it, so I was able to put in this line in the custom plugin, and it works:

    $ptn = '(CGIProxy\\.fcgi)';

    Thanks! Solved.

    Thread Starter Fahrenhe1t

    (@fahrenhe1t)

    Feature request for the future: would it be easier to create a CSS class that could be applied to images that would force Simple Lightbox to view them? Might be easier than building custom plugins for each image type. Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘SLB Not Working with CGI-fetched Image’ is closed to new replies.