Monthly Archives: June 2016

Click to edit in Mobile Angular UI

0. Assume the text’s ng-model to be changed is  {{someText}}

1. Create a modal.

2. Let there be an input in the modal. The input’s ng-model should not be {{someText}}, but {{anotherText}}

3. Let there be 2 buttons in the modal. One is "cancel", the other is "ok".  For "ok’,  ng-click = "submitChange()";  

4. Let there a button to turn on the modal. Instead of setting "ui-turn-on", use ng-click="showModal()" 

5. In function showModal(),  do 2 jobs:

   a. $scope. anotherText = someText;

   b. and $rootScope.Ui.turnOn("the_modal");

6. In function  submitChange(), do 2 jobs:

   a. send {{anotherText}}’s value to the server side

   b. If success, set {{someText}}’s value to {{anotherText}}’s value

Python: PIL generates an image too big?

You’ve tried thumbnail(), resize(), save(quality=20),  but you still get an image too big?

Maybe it’s because you are generating a PNG file.  Change it to JPG and you will get a much smaller file !

It’s because PNG format is a lossless compression file format.  Without losing quality you can’t get a considerably small image file.