made sure project thumbnails are normalized when saved

upd4.2
Jens Mönig 2018-02-08 23:43:16 +01:00
rodzic d9355f4adf
commit 1a855f81ed
2 zmienionych plików z 12 dodań i 5 usunięć

Wyświetl plik

@ -29,7 +29,8 @@
// Global settings /////////////////////////////////////////////////////
/*global modules, SnapSerializer, nop, hex_sha512, DialogBoxMorph, Color*/
/*global modules, SnapSerializer, nop, hex_sha512, DialogBoxMorph, Color,
normalizeCanvas*/
modules.cloud = '2018-February-08';
@ -320,8 +321,10 @@ Cloud.prototype.saveProject = function (ide, onSuccess, onError) {
function (username) {
if (username) {
var xml = ide.serializer.serialize(ide.stage),
thumbnail = ide.stage.thumbnail(
SnapSerializer.prototype.thumbnailSize).toDataURL(),
thumbnail = normalizeCanvas(
ide.stage.thumbnail(
SnapSerializer.prototype.thumbnailSize
)).toDataURL(),
body, mediaSize, size;
ide.serializer.isCollectingMedia = true;
@ -452,8 +455,11 @@ Cloud.prototype.getThumbnail = function (
) {
this[username ? 'request' : 'withCredentialsRequest'](
'GET',
'/projects/' + (username || '%username') + '/'
+ projectName + '/thumbnail',
'/projects/' +
(username || '%username') +
'/' +
projectName +
'/thumbnail',
onSuccess,
onError,
'Could not fetch thumbnail',

Wyświetl plik

@ -3939,6 +3939,7 @@ Translation Updates:
* Cloud, GUI, Widgets: New Cloud API, thanks, Bernat!
* GUI: fixed a url-bar refresh bug introduced by the new cloud mechanism
* GUI: made sure user names are lower case when sent to the cloud
* Cloud: made sure project thumbnails are normalized when saved
=== v4.1.2 features ===