MCPcopy Create free account
hub / github.com/totaljs/framework / $image_nocache

Function $image_nocache

index.js:18637–18669  ·  view source on GitHub ↗
(res)

Source from the content-addressed store, hash-verified

18635}
18636
18637function $image_nocache(res) {
18638
18639 var options = res.options;
18640
18641 // STREAM
18642 if (options.stream) {
18643 var image = framework_image.load(options.stream);
18644 options.make.call(image, image, res);
18645 options.type = U.getContentType(image.outputType);
18646 options.stream = image;
18647 F.stats.response.image++;
18648 res.$stream();
18649 return F;
18650 }
18651
18652 // FILENAME
18653 fsFileExists(options.filename, function(e) {
18654
18655 if (e) {
18656 F.path.verify('temp');
18657 var image = framework_image.load(options.filename);
18658 options.make.call(image, image, res);
18659 F.stats.response.image++;
18660 options.type = U.getContentType(image.outputType);
18661 options.stream = image;
18662 res.$stream();
18663 } else {
18664 options.headers = null;
18665 if (!F.routes.filesfallback || !F.routes.filesfallback(res.req, res))
18666 res.throw404();
18667 }
18668 });
18669}
18670
18671function $image_processing(res) {
18672 res.$image();

Callers 1

extend_responseFunction · 0.85

Calls 1

fsFileExistsFunction · 0.85

Tested by

no test coverage detected