pbagrecha-mpb15-1490:~ pbagrecha$ curl -v "http://localhost:8000/unsafe/filters:watermark(https://google.com,-10,-10,50)/images/gracenote/assets/p10492765_e_h9_ab.jpg"
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 8000 (#0)
> GET /unsafe/filters:watermark(https://google.com,-10,-10,50)/images/gracenote/assets/p10492765_e_h9_ab.jpg HTTP/1.1
> Host: localhost:8000
> User-Agent: curl/7.58.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
pbagrecha-mpb15-1490:~ pbagrecha$
pbagrecha-mpb15-1490:docker-thumbor pbagrecha$ docker run -e AWS_ACCESS_KEY_ID='<access_key>' -e AWS_SECRET_ACCESS_KEY='<secret_key>' -e TC_AWS_LOADER_BUCKET='<s3_bucket>' -e LOADER='tc_aws.loaders.presigning_loader' -e TC_AWS_REGION='us-east-1' -e TC_AWS_ENABLE_HTTP_LOADER='True' -e RESULT_STORAGE_STORES_UNSAFE='False' -e STORES_CRYPTO_KEY_FOR_EACH_IMAGE='False' -e TC_AWS_STORE_METADATA='False' -e OPTIMIZERS="['thumbor.optimizers.jpegtran']" -e ENGINE='opencv_engine' -e MAX_AGE='604800' -e QUALITY='100' -e LOG_LEVEL=debug -p 8000:8000 apsl/thumbor
2018-03-06 21:27:05 root:DEBUG thumbor running at 0.0.0.0:8000
2018-03-06 21:27:09 thumbor:DEBUG METRICS: inc: response.count:1
2018-03-06 21:27:09 thumbor:DEBUG METRICS: inc: storage.miss:1
2018-03-06 21:27:09 botocore.credentials:DEBUG Looking for credentials via: env
2018-03-06 21:27:09 botocore.credentials:INFO Found credentials in environment variables.
2018-03-06 21:27:09 botocore.client:DEBUG Registering retry handlers for service: s3
2018-03-06 21:27:09 botocore.hooks:DEBUG Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x7fca09603578>
2018-03-06 21:27:09 botocore.hooks:DEBUG Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x7fca095ed500>
2018-03-06 21:27:09 botocore.endpoint:DEBUG Setting s3 timeout as (60, 60)
2018-03-06 21:27:09 thumbor:DEBUG Cleaning key: images/gracenote/assets/p10492765_e_h9_ab.jpg
2018-03-06 21:27:09 thumbor:DEBUG Cleansed key: images/gracenote/assets/p10492765_e_h9_ab.jpg
2018-03-06 21:27:09 botocore.utils:DEBUG Checking for DNS compatible bucket for: https://s3.amazonaws.com/<s3_bucket>/images/gracenote/assets/p10492765_e_h9_ab.jpg
2018-03-06 21:27:09 botocore.utils:DEBUG Not changing URI, bucket is not DNS compatible: <s3_bucket>
2018-03-06 21:27:09 botocore.auth:DEBUG Calculating signature using hmacv1 auth.
2018-03-06 21:27:09 botocore.auth:DEBUG HTTP request method: GET
2018-03-06 21:27:09 botocore.auth:DEBUG StringToSign:
GET
1520375229
/<s3_bucket>/images/gracenote/assets/p10492765_e_h9_ab.jpg
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG GET https://s3.amazonaws.com/<s3_bucket>/images/gracenote/assets/p10492765_e_h9_ab.jpg?AWSAccessKeyId=AKIAIQ6ASSOSDZVWHLBA&Expires=1520375229&Signature=R23hZCHtlFRdYNAqQlcnU%2BTztNI%3D
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG Hostname was NOT found in DNS cache
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG Trying 54.231.82.92...
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG Connected to s3.amazonaws.com (54.231.82.92) port 443 (#0)
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG successfully set certificate verify locations:
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG CAfile: none
CApath: /etc/ssl/certs
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client hello (1):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server hello (2):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, CERT (11):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server key exchange (12):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server finished (14):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client key exchange (16):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG Server certificate:
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG subject: C=US; ST=Washington; L=Seattle; O=Amazon.com Inc.; CN=s3.amazonaws.com
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG start date: 2017-09-26 00:00:00 GMT
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG expire date: 2018-09-20 12:00:00 GMT
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG subjectAltName: s3.amazonaws.com matched
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert Baltimore CA-2 G2
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG SSL certificate verify ok.
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG > GET /<s3_bucket>/images/gracenote/assets/p10492765_e_h9_ab.jpg?AWSAccessKeyId=AKIAIQ6ASSOSDZVWHLBA&Expires=1520375229&Signature=R23hZCHtlFRdYNAqQlcnU%2BTztNI%3D HTTP/1.1
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG > User-Agent: Thumbor/6.3.0
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG > Host: s3.amazonaws.com
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG > Accept: */*
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG > Accept-Encoding: gzip,deflate
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG >
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < HTTP/1.1 200 OK
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < x-amz-id-2: m8v0TDRZfjCU0q4WJBDStgy6yivJ14PxfcUBDhP6TDHIEXHjVpWzi2gm3ZF2p+0VoVOXlt4onRg=
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < x-amz-request-id: 2BBDD3B5740DEB55
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Date: Tue, 06 Mar 2018 21:27:10 GMT
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Last-Modified: Fri, 02 Mar 2018 20:19:14 GMT
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < ETag: "8e2fc13a6a32fa15ab5927b51246d4a9"
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Cache-Control: max-age=604800
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < x-amz-meta-etag: "8e2fc13a6a32fa15ab5927b51246d4a9"
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < x-amz-version-id: null
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < x-amz-meta-lastmodified: Sat, 28 Jan 2017 12:40:44 GMT
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Accept-Ranges: bytes
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Content-Type: image/jpeg
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Content-Length: 230154
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG Server AmazonS3 is not blacklisted
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG < Server: AmazonS3
2018-03-06 21:27:09 tornado.curl_httpclient:DEBUG <
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Connection #0 to host s3.amazonaws.com left intact
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.fetch.200.s3.amazonaws.com:811
2018-03-06 21:27:10 thumbor:DEBUG METRICS: inc: original_image.status.200:1
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.redirect:0
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.queue:0
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.pretransfer:238
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.starttransfer:525
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.total:809
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.connect:81
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.namelookup:7
2018-03-06 21:27:10 thumbor:DEBUG METRICS: timing: original_image.time_info.bytes_per_second:284405
2018-03-06 21:27:10 thumbor:DEBUG METRICS: inc: original_image.response_bytes:230154
2018-03-06 21:27:10 thumbor:DEBUG creating tempfile for images/gracenote/assets/p10492765_e_h9_ab.jpg in /data/storage/70/2d55d55b39c5c6d330da45da49eb7dc38de72f.edf3b4e06c9e4e9cb1e5dc3f9bc27794...
2018-03-06 21:27:10 thumbor:DEBUG moving tempfile /data/storage/70/2d55d55b39c5c6d330da45da49eb7dc38de72f.edf3b4e06c9e4e9cb1e5dc3f9bc27794 to /data/storage/70/2d55d55b39c5c6d330da45da49eb7dc38de72f...
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG GET https://google.com
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Rebuilt URL to: https://google.com/
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Hostname was NOT found in DNS cache
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Trying 216.58.217.78...
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Connected to google.com (216.58.217.78) port 443 (#1)
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG successfully set certificate verify locations:
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG CAfile: none
CApath: /etc/ssl/certs
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server hello (2):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, CERT (11):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server key exchange (12):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server finished (14):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client key exchange (16):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Server certificate:
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=*.google.com
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG start date: 2018-02-20 14:33:16 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG expire date: 2018-05-15 14:08:00 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG subjectAltName: google.com matched
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG issuer: C=US; O=Google Inc; CN=Google Internet Authority G2
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSL certificate verify ok.
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > GET / HTTP/1.1
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > User-Agent: Thumbor/6.3.0
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Host: google.com
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Accept: */*
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Accept-Encoding: gzip,deflate
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG >
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < HTTP/1.1 301 Moved Permanently
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Location: https://www.google.com/
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Content-Type: text/html; charset=UTF-8
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Date: Tue, 06 Mar 2018 21:27:10 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Expires: Thu, 05 Apr 2018 21:27:10 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Cache-Control: public, max-age=2592000
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Server gws is not blacklisted
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Server: gws
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Content-Length: 220
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < X-XSS-Protection: 1; mode=block
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < X-Frame-Options: SAMEORIGIN
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG < Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="41,39,35"
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG <
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Ignoring the response-body
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Connection #1 to host google.com left intact
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Issue another request to this URL: 'https://www.google.com/'
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Hostname was NOT found in DNS cache
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Trying 172.217.13.68...
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Connected to www.google.com (172.217.13.68) port 443 (#2)
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG successfully set certificate verify locations:
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG CAfile: none
CApath: /etc/ssl/certs
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server hello (2):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, CERT (11):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server key exchange (12):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Server finished (14):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Client key exchange (16):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS change cipher, Client hello (1):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSLv3, TLS handshake, Finished (20):
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG Server certificate:
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG subject: C=US; ST=California; L=Mountain View; O=Google Inc; CN=www.google.com
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG start date: 2018-02-20 14:08:00 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG expire date: 2018-05-15 14:08:00 GMT
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG subjectAltName: www.google.com matched
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG issuer: C=US; O=Google Inc; CN=Google Internet Authority G2
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG SSL certificate verify ok.
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > GET / HTTP/1.1
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > User-Agent: Thumbor/6.3.0
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Host: www.google.com
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Accept: */*
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG > Accept-Encoding: gzip,deflate
2018-03-06 21:27:10 tornado.curl_httpclient:DEBUG >
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < HTTP/1.1 200 OK
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Date: Tue, 06 Mar 2018 21:27:11 GMT
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Expires: -1
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Cache-Control: private, max-age=0
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Content-Type: text/html; charset=ISO-8859-1
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Content-Encoding: gzip
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG Server gws is not blacklisted
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Server: gws
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < X-XSS-Protection: 1; mode=block
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < X-Frame-Options: SAMEORIGIN
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Set-Cookie: 1P_JAR=2018-03-06-21; expires=Thu, 05-Apr-2018 21:27:11 GMT; path=/; domain=.google.com
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Set-Cookie: NID=125=YXwimxjfmQRS3Ov_4b5cRpOdH1VNb0w9Agwog_-8jthHdd-kHK7oTF4znSZBPUPpEy3ehnc50IwjV3Cs8kZRdz_eScVD2yZdaRfl40VqheKJ9OYfBtisRDmGlP_d2qhd; expires=Wed, 05-Sep-2018 21:27:11 GMT; path=/; domain=.google.com; HttpOnly
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Alt-Svc: hq=":443"; ma=2592000; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="41,39,35"
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG < Transfer-Encoding: chunked
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG <
2018-03-06 21:27:11 tornado.curl_httpclient:DEBUG Connection #2 to host www.google.com left intact
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.fetch.200.google.com:825
2018-03-06 21:27:11 thumbor:DEBUG METRICS: inc: original_image.status.200:1
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.redirect:385
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.queue:0
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.pretransfer:321
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.starttransfer:432
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.total:823
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.connect:96
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.namelookup:3
2018-03-06 21:27:11 thumbor:DEBUG METRICS: timing: original_image.time_info.bytes_per_second:15263
2018-03-06 21:27:11 thumbor:DEBUG METRICS: inc: original_image.response_bytes:12572
pbagrecha-mpb15-1490:docker-thumbor pbagrecha$
If you notice the process just died after trying to handle the request.
import cv
f = open('index.html', 'rb')
buf = f.read()
print(buf[0:32])
# <!doctype html><html itemscope="
imagefiledata = cv.CreateMatHeader(1, len(buf), cv.CV_8UC1)
cv.SetData(imagefiledata, buf, len(buf))
img0 = cv.DecodeImageM(imagefiledata, cv.CV_LOAD_IMAGE_UNCHANGED)
# Segmentation fault (core dumped)
# python[11900]: segfault at 8 ip 00007f0e56a346c9 sp 00007ffd741c4e30 error 4 in cv2.so[7f0e569fc000+151000]