Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16475] Android: Regression: Saving an image **after** transformation, will produce the original image

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-27T18:11:41.000+0000
Affected Version/sRelease 3.2.1
Fix Version/sn/a
ComponentsAndroid
LabelssupportTeam
ReporterMauro Parra-Miranda
AssigneeEric Merriman
Created2014-02-19T05:21:00.000+0000
Updated2017-06-27T18:11:41.000+0000

Description

Problem Description

In 3.1.3.GA, you were able to "save" the images after transformations. Starting with 3.2.0, the saved image will reflect the original image, not the one after the transformation.

Test Case

var win = Titanium.UI.createWindow({
	title : "Test",
});
win.backgroundColor = '#13386c';

var t1 = Ti.UI.create2DMatrix();
	t1 = t1.rotate(35);
	t1 = t1.scale(0.4);
var cloud1 = Titanium.UI.createView({
	backgroundImage : 'KS_nav_ui.png',
	height : 178,
	width : 261,
	top : 10,
	transform:t1
});

win.add(cloud1);
var button = Titanium.UI.createButton({
	title : 'Transform & Copy',
	width : 200,
	height : 40,
	bottom : 20
});

button.addEventListener('click', function() {
	var img = Titanium.UI.createImageView({
		image : cloud1.toImage(),
		top : 200,
	});
	win.add(img);
});

win.add(button);
win.open();

Steps to reproduce the issue

1. Create a new mobile project (classic titanium) 2. Paste the code sample into app.js 3. Run it 4. You will see a transformed image in the screen. 5. Press the label that will produce a copy of the image 6. You will see the image being added to the window, with the original size and setup.

Q&A Related question

http://developer.appcelerator.com/question/162746/toimage-does-not-respect-transform-on-320-android

Comments

  1. Lee Morris 2017-06-27

    I am unable to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170623141152 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source