From d921021132367076cd2a5f120b3a49db6e29acf7 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 28 Jul 2020 23:41:35 +0300 Subject: Loading and rendering images in the document There can be multiple inline media requests on the page. Images are always associated with a link. --- src/gmrequest.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gmrequest.c') diff --git a/src/gmrequest.c b/src/gmrequest.c index ad0c5ed7..25ff90af 100644 --- a/src/gmrequest.c +++ b/src/gmrequest.c @@ -163,8 +163,6 @@ static void requestFinished_GmRequest_(iAnyObject *obj) { } SDL_RemoveTimer(d->timeoutId); d->timeoutId = 0; -// iReleaseLater(d->req); -// d->req = NULL; d->state = finished_GmRequestState; unlock_Mutex(&d->mutex); iNotifyAudience(d, finished, GmRequestFinished); @@ -193,6 +191,15 @@ void submit_GmRequest(iGmRequest *d) { else if (endsWithCase_String(path, ".txt")) { setCStr_String(&d->header, "text/plain"); } + else if (endsWithCase_String(path, ".png")) { + setCStr_String(&d->header, "image/png"); + } + else if (endsWithCase_String(path, ".jpg") || endsWithCase_String(path, ".jpeg")) { + setCStr_String(&d->header, "image/jpeg"); + } + else if (endsWithCase_String(path, ".gif")) { + setCStr_String(&d->header, "image/gif"); + } else { setCStr_String(&d->header, "application/octet-stream"); } -- cgit v1.2.3