W3C home > Mailing lists > Public > public-media-fragment@w3.org > March 2009

Problem with percentage-based image cropping

From: Jack Jansen <Jack.Jansen@cwi.nl>
Date: Mon, 30 Mar 2009 14:49:48 +0200
Message-Id: <1DAF6A54-BD6F-4DD6-AC21-B4C15DFFAFEC@cwi.nl>
To: Media Fragment <public-media-fragment@w3.org>
Yet another thing that came up while implementing: percentage-based  
cropping has a problem if it isn't done on the server, unless the  
server reports back all relevant information (original size and  
cropped size) to the client.

Assume we have a crop of 25%, 25%, 50%, 50%, i.e. the middle 320x240  
pixels of a 640x480 picture.

If the server returns the original image there is no problem: we can  
do the cropping client side. The only thing required is that the  
server somehow indicates that it hasn't done the cropping for us  
(possibly by being completely silent on the issue).

If the server does do the exact cropping we requested it could either  
tell the client "Don't worry, all cropping has been done". But if the  
server wants the freedom to do partial cropping (for example because  
if wants to do cropping without transcoding) it must tell the client  
both the original (w, h) and the cropped (x, y, cropped_w, cropped_h).  
Otherwise the client can't do the calculations to compute the  
(pixel_x, pixel_y, pixel_w, pixel_h) coordinates.

Jack Jansen, <Jack.Jansen@cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma  
Received on Monday, 30 March 2009 12:50:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:27:42 UTC