Commit Graph

13 Commits

Author SHA1 Message Date
Nicholas Guriev a7c89b0e3f
Do not reopen stdout while image resizing
On Linux, some web-servers (Apache in particular) close file with fd = 1 and
offer something else as stdout. Notable difference can be seen with a pipe and
an immediate redirection. Consider:

  $ REQUEST_URI=/avatar/68b329da9893e34099c7d8ad5cb9c940 libravatarserv | cat > /tmp/response1.out
  $ REQUEST_URI=/avatar/68b329da9893e34099c7d8ad5cb9c940 libravatarserv > /tmp/response2.out
  $ diff -s /tmp/response{1,2}.out
  Binary files /tmp/response1.out and /tmp/response2.out differ

Solution.

The output should be identical in both cases. So do not let ImageMagick to open
/dev/stdout by itself, instead write the resulted image to an in-memory buffer
and then to a file associated with the "cout" global object.
2020-10-23 21:13:47 +03:00
tastytea a909b0405c
Deleted old identicon code. 2018-12-26 05:55:18 +01:00
tastytea 41299b9529
Transformed some errors into warnings. 2018-12-26 05:47:06 +01:00
tastytea 3bdcd7b120
Include only necessary Magick++-headers.
the build was successful Details
2018-12-01 11:33:32 +01:00
tastytea 785cd7a35f
Refactored settings-stuff into own file.
the build was successful Details
2018-11-30 07:00:37 +01:00
tastytea 513391f44b
Replaced "\n\n" with << endl << endl for consistency
the build was successful Details
2018-11-29 13:45:46 +01:00
tastytea ec140aad01
Bugfix: detect file type and send appropriate Content-Type. 2018-11-29 13:40:50 +01:00
tastytea cf6b1f84aa
Initialize pseudorandom number with 2^64-1
the build was successful Details
2018-11-27 12:01:03 +01:00
tastytea 87bedbbf7b
typo
the build was successful Details
2018-11-27 10:14:44 +01:00
tastytea 645554e226
Added identicon support (closes #2)
the build failed Details
2018-11-27 10:05:35 +01:00
tastytea 43232d802b
Added support for mystery person (aka mystery man)
the build was successful Details
2018-11-27 04:40:17 +01:00
tastytea 8f0baeb028
Changed default filename drom default.png to default. 2018-11-25 06:32:26 +01:00
tastytea f550b7b048
Oops, forgot to commit in between. :-) 2018-11-25 06:00:45 +01:00