Speed up image fetch

This commit is contained in:
Jamie Cameron
2018-10-08 22:12:49 +00:00
parent 81fbde18ee
commit 70d2e6f364

View File

@@ -53,13 +53,13 @@ if ($in{'scale'}) {
($jpegin, $jpegout) = &pipeopen("pnmscale $scale 2>/dev/null | cjpeg");
print $jpegin $type;
print $jpegin $size;
while(read($pnmout, $buf, 1024)) {
while(read($pnmout, $buf, 32768)) {
print $jpegin $buf;
}
close($jpegin);
close($pnmout);
print "Content-type: image/jpeg\n\n";
while(read($jpegout, $buf, 1024)) {
while(read($jpegout, $buf, 32768)) {
print $buf;
}
close($jpegout);