POTD widget fails with huge images
See original GitHub issueSummary:
Today’s POTD is massive, which causes max parcel memory limit to be exceeded.
https://upload.wikimedia.org/wikipedia/commons/c/cb/Attacus_taprobanis-Kadavoor-2018-07-13-001.jpg
It would be good to get a smaller version of the file to avoid this.
2019-03-30 14:10:13.462 20695-20821/fr.free.nrw.commons E/unknown:: unhandled exception
java.lang.IllegalArgumentException: RemoteViews for widget update exceeds maximum bitmap memory usage (used: 6000000, max: 5529600)
at android.os.Parcel.createException(Parcel.java:1946)
at android.os.Parcel.readException(Parcel.java:1910)
at android.os.Parcel.readException(Parcel.java:1860)
at com.android.internal.appwidget.IAppWidgetService$Stub$Proxy.updateAppWidgetIds(IAppWidgetService.java:697)
at android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:515)
at android.appwidget.AppWidgetManager.updateAppWidget(AppWidgetManager.java:588)
at fr.free.nrw.commons.widget.PicOfDayAppWidget$1.onNewResultImpl(PicOfDayAppWidget.java:111)
at com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber.onNewResultImpl(BaseBitmapDataSubscriber.java:60)
at com.facebook.datasource.BaseDataSubscriber.onNewResult(BaseDataSubscriber.java:46)
at com.facebook.datasource.AbstractDataSource$1.run(AbstractDataSource.java:176)
at com.facebook.common.executors.CallerThreadExecutor.execute(CallerThreadExecutor.java:47)
at com.facebook.datasource.AbstractDataSource.notifyDataSubscriber(AbstractDataSource.java:167)
at com.facebook.datasource.AbstractDataSource.notifyDataSubscribers(AbstractDataSource.java:158)
at com.facebook.datasource.AbstractDataSource.setResult(AbstractDataSource.java:210)
at com.facebook.imagepipeline.datasource.AbstractProducerToDataSourceAdapter.onNewResultImpl(AbstractProducerToDataSourceAdapter.java:93)
at com.facebook.imagepipeline.datasource.CloseableProducerToDataSourceAdapter.onNewResultImpl(CloseableProducerToDataSourceAdapter.java:63)
at com.facebook.imagepipeline.datasource.CloseableProducerToDataSourceAdapter.onNewResultImpl(CloseableProducerToDataSourceAdapter.java:24)
at com.facebook.imagepipeline.datasource.AbstractProducerToDataSourceAdapter$1.onNewResultImpl(AbstractProducerToDataSourceAdapter.java:71)
at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:97)
at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer.onNextResult(MultiplexProducer.java:452)
at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl(MultiplexProducer.java:513)
at com.facebook.imagepipeline.producers.MultiplexProducer$Multiplexer$ForwardingConsumer.onNewResultImpl(MultiplexProducer.java:506)
at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:97)
at com.facebook.imagepipeline.producers.BitmapMemoryCacheProducer$1.onNewResultImpl(BitmapMemoryCacheProducer.java:167)
at com.facebook.imagepipeline.producers.BitmapMemoryCacheProducer$1.onNewResultImpl(BitmapMemoryCacheProducer.java:118)
at com.facebook.imagepipeline.producers.BaseConsumer.onNewResult(BaseConsumer.java:97)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.handleResult(DecodeProducer.java:397)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:319)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:124)
at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:166)
at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:202)
at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:22)
at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:51)
at java.lang.Thread.run(Thread.java:764)
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Popular Posts Widget AJAX loaded, Image causing large ...
The Widget itself is AJAX loaded. The images are lazy loaded. Problem: layout shift happening at a higher rate which results into a...
Read more >D29140 Show POTD in lock screen - KDE's Phabricator
Create an invisible lock screen widget in the desktop, so it fetches ... So this only fixes the problem when the POTD image...
Read more >There was no NASA Astronomy Picture of the Day app with ...
There was no NASA Astronomy Picture of the Day app with iOS 14 widgets, ... I did notice the app crashes when trying...
Read more >Topic: Widget images added too large | WordPress.com Forums
I use small images of my book covers in the sidebar on my blog page. Today I tried to update one and though...
Read more >Bringing Wikipedia to the homescreen on iOS
Widgets can come in three sizes (small, medium and large) and two ... The first widget we designed was the Picture of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As per the current code base, even on clicking the image, the media detail view shows the 640 width image as
MediaDetailFragment
also usesMediaWikiImageView
. Will be fixing this too.Going forward,
The API that we use lets us specify the height and width properties.
API doc: https://www.mediawiki.org/wiki/API:Imageinfo
We can either choose to send these params for all our media calls, which would mean adding these params in
appendMediaProperties
method. Otherwise, if we want to send these params only for POTD, thengetPictureOfTheDay
needs to be edited.Should we hardcode the height and width or should be it determined on the phone’s hardware capabilities? @domdomegg @misaochan