diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java index d2874b2f6..834914cf3 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java @@ -2058,19 +2058,21 @@ public class BoardActivity extends XWActivity private void takeSnapshot() { if ( GitVersion.THUMBNAIL_SUPPORTED ) { - final int size = 150; - Bitmap thumb = - Bitmap.createBitmap( size, size, Bitmap.Config.ARGB_8888 ); + Bitmap thumb = null; + int scale = XWPrefs.getThumbScale( this ); + if ( 0 < scale ) { + final int size = 15 * (9 + scale); + thumb = Bitmap.createBitmap( size, size, Bitmap.Config.ARGB_8888 ); - Rect bounds = new Rect( 0, 0, size, size ); - XwJNI.board_figureLayout( m_jniGamePtr, m_gi, 0, 0, 5, 5, false, - bounds, null ); - - ThumbCanvas canvas = new ThumbCanvas( this, thumb ); - XwJNI.board_setDraw( m_jniGamePtr, canvas ); - XwJNI.board_invalAll( m_jniGamePtr ); - XwJNI.board_draw( m_jniGamePtr ); + Rect bounds = new Rect( 0, 0, size, size ); + XwJNI.board_figureLayout( m_jniGamePtr, m_gi, 0, 0, 5, 5, false, + bounds, null ); + ThumbCanvas canvas = new ThumbCanvas( this, thumb ); + XwJNI.board_setDraw( m_jniGamePtr, canvas ); + XwJNI.board_invalAll( m_jniGamePtr ); + XwJNI.board_draw( m_jniGamePtr ); + } DBUtils.saveThumbnail( this, m_gameLock, thumb ); } } diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java index bd5447cd1..d4f43acea 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DBUtils.java @@ -445,9 +445,14 @@ public class DBUtils { ContentValues values = new ContentValues(); String selection = String.format( ROW_ID_FMT, lock.getRowid() ); - ByteArrayOutputStream bas = new ByteArrayOutputStream(); - thumb.compress( CompressFormat.PNG, 0, bas ); - values.put( DBHelper.THUMBNAIL, bas.toByteArray() ); + if ( null == thumb ) { + DbgUtils.logf( "clearing thumbnail" ); + values.putNull( DBHelper.THUMBNAIL ); + } else { + ByteArrayOutputStream bas = new ByteArrayOutputStream(); + thumb.compress( CompressFormat.PNG, 0, bas ); + values.put( DBHelper.THUMBNAIL, bas.toByteArray() ); + } long result = db.update( DBHelper.TABLE_NAME_SUM, values, selection, null );