2018-11-24 11:00:07 +01:00
|
|
|
/* This file is part of libravatarserv.
|
|
|
|
* Copyright © 2018 tastytea <tastytea@tastytea.de>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, version 3.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <iostream>
|
2018-11-24 12:40:49 +01:00
|
|
|
#include <cstdlib> // getenv()
|
|
|
|
#include <png++/png.hpp>
|
2018-11-24 11:00:07 +01:00
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2018-11-24 12:40:49 +01:00
|
|
|
cout << "Content-type: image/png\r\n\r\n";
|
2018-11-24 11:00:07 +01:00
|
|
|
cout << std::getenv("REQUEST_URI") << "\r\n";
|
2018-11-24 12:40:49 +01:00
|
|
|
|
|
|
|
png::image<png::rgba_pixel> image(argv[1]);
|
|
|
|
|
|
|
|
image.write("/dev/stdout");
|
|
|
|
|
2018-11-24 11:00:07 +01:00
|
|
|
return 0;
|
|
|
|
}
|