question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SVG format not loading

See original GitHub issue

Description

When trying to load this SVG file, the image is not loaded and a java.lang.IllegalArgumentException is thrown.

Reproduction

On ImageFormatSvgFragment.java class change URI_SVG_HALF_TRANSPARENT attribute from Uri.parse("http://frescolib.org/static/sample-images/fresco_logo_half_transparent.svg"); to Uri.parse("https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg"); run the showcase app, enable SVG support and restart the app. Looking at logcat we have the following:

07-17 15:20:19.855 13973 13973 V unknown:AbstractDraweeController: controller 2c6609d null -> 0: initialize
07-17 15:20:19.857 13973 13973 V unknown:AbstractDraweeController: controller 2c6609d 0: setHierarchy: com.facebook.drawee.generic.GenericDraweeHierarchy@6552912
07-17 15:20:19.892 13973 13973 V unknown:AbstractDraweeController: controller 2c6609d 0: onAttach: request needs submit
07-17 15:20:19.922 13973 13973 V unknown:RequestLoggingListener: time 6584062: onRequestSubmit: {requestId: 0, callerContext: null, isPrefetch: false}
07-17 15:20:19.930 13973 13973 V unknown:RequestLoggingListener: time 6584069: onProducerStart: {requestId: 0, producer: BitmapMemoryCacheGetProducer}
07-17 15:20:19.932 13973 13973 V unknown:RequestLoggingListener: time 6584072: onProducerFinishWithSuccess: {requestId: 0, producer: BitmapMemoryCacheGetProducer, elapsedTime: 3 ms, extraMap: {cached_value_found=false}}
07-17 15:20:19.935 13973 13973 V unknown:RequestLoggingListener: time 6584075: onProducerStart: {requestId: 0, producer: BackgroundThreadHandoffProducer}
07-17 15:20:19.938 13973 13973 V unknown:AbstractDraweeController: controller 2c6609d 0: submitRequest: dataSource: dd4703f
07-17 15:20:19.938 13973 14017 V unknown:RequestLoggingListener: time 6584077: onProducerFinishWithSuccess: {requestId: 0, producer: BackgroundThreadHandoffProducer, elapsedTime: 2 ms, extraMap: null}
07-17 15:20:19.945 13973 14017 V unknown:RequestLoggingListener: time 6584085: onProducerStart: {requestId: 0, producer: BitmapMemoryCacheProducer}
07-17 15:20:19.947 13973 14017 V unknown:RequestLoggingListener: time 6584086: onProducerFinishWithSuccess: {requestId: 0, producer: BitmapMemoryCacheProducer, elapsedTime: 1 ms, extraMap: {cached_value_found=false}}
07-17 15:20:19.965 13973 14017 V unknown:RequestLoggingListener: time 6584105: onProducerStart: {requestId: 0, producer: EncodedMemoryCacheProducer}
07-17 15:20:19.966 13973 14017 V unknown:RequestLoggingListener: time 6584106: onProducerFinishWithSuccess: {requestId: 0, producer: EncodedMemoryCacheProducer, elapsedTime: 1 ms, extraMap: {cached_value_found=false}}
07-17 15:20:19.967 13973 14017 V unknown:RequestLoggingListener: time 6584106: onProducerStart: {requestId: 0, producer: DiskCacheProducer}
07-17 15:20:19.978 13973 14018 V unknown:BufferedDiskCache: Did not find image for https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg in staging area
07-17 15:20:19.979 13973 14018 V unknown:BufferedDiskCache: Disk cache read for https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg
07-17 15:20:20.009 13973 14018 V unknown:BufferedDiskCache: Found entry in disk cache for https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg
07-17 15:20:20.051 13973 14018 V unknown:BufferedDiskCache: Successful read from disk cache for https://upload.wikimedia.org/wikipedia/commons/0/02/SVG_logo.svg
07-17 15:20:20.055 13973 14018 V unknown:RequestLoggingListener: time 6584195: onProducerFinishWithSuccess: {requestId: 0, producer: DiskCacheProducer, elapsedTime: 89 ms, extraMap: {cached_value_found=true, encodedImageSize=1556}}
07-17 15:20:20.055 13973 14018 V unknown:RequestLoggingListener: time 6584195: onUltimateProducerReached: {requestId: 0, producer: DiskCacheProducer, elapsedTime: -1 ms, success: true}
07-17 15:20:20.069 13973 14034 V unknown:RequestLoggingListener: time 6584209: onProducerStart: {requestId: 0, producer: DecodeProducer}
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener: time 6584210: onProducerFinishWithFailure: {requestId: 0, stage: DecodeProducer, elapsedTime: 1 ms, extraMap: {sampleSize=1, hasGoodQuality=true, imageFormat=UNKNOWN, isFinal=true, encodedImageSize=-1x-1, queueTime=2, requestedImageSize=unknown}, throwable: java.lang.IllegalArgumentException: unknown image format}
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener: java.lang.IllegalArgumentException: unknown image format
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.decoder.DefaultImageDecoder$1.decode(DefaultImageDecoder.java:68)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.decoder.DefaultImageDecoder.decode(DefaultImageDecoder.java:125)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.doDecode(DecodeProducer.java:248)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder.access$200(DecodeProducer.java:112)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.DecodeProducer$ProgressiveDecoder$1.run(DecodeProducer.java:145)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.JobScheduler.doJob(JobScheduler.java:207)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.JobScheduler.access$000(JobScheduler.java:27)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.producers.JobScheduler$1.run(JobScheduler.java:78)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at com.facebook.imagepipeline.core.PriorityThreadFactory$1.run(PriorityThreadFactory.java:43)
07-17 15:20:20.071 13973 14034 W unknown:RequestLoggingListener:        at java.lang.Thread.run(Thread.java:818)
07-17 15:20:20.072 13973 14034 W unknown:RequestLoggingListener: time 6584212: onRequestFailure: {requestId: 0, elapsedTime: 150 ms, throwable: java.lang.IllegalArgumentException: unknown image format}
07-17 15:20:20.200 13973 13973 V unknown:AbstractDraweeController: controller 2c6609d 0: final_failed @ onFailure: failure: java.lang.IllegalArgumentException: unknown image format

Additional Information

  • Fresco version: 1.4.0
  • Platform version: SDK 23 (6.0)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
a-d-collinscommented, Aug 13, 2017

@filipedelimabrito, can you confirm that this issue can be closed? I believe that my fixes should have solved your SVG issue.

0reactions
oprisnikcommented, Aug 15, 2017

Yeah, this should be fixed now. Let us know if you’re still experiencing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG images not loading on Chrome (sometimes)
The images do load if I open the image seperatly and then view the page after opening it.
Read more >
SVG file not showing - Bugs - Forum | Webflow
They show properly for a couple of seconds and then disappear. The image element is still there, linked to the right file, but...
Read more >
Image and svg not loading on page - The freeCodeCamp Forum
I have checked the file path and file type everything is ok. It outputs the alt attribute but not the image itself. The...
Read more >
Importing svg not working properly - Ask the community
Opening svg / vector file in Illustrator (*I haven't tried any other programs) · Select “File” → “Save As” or “Save a Copy”...
Read more >
SVGs not displaying in Chrome (Example) - Treehouse
The file paths are correct, but the SVGs are only displaying broken image icons ... I actually had a problem with loading .svg...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found