Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

EditArtwork does not work with ImagePath #22

Open
shaan-mephobic opened this issue Sep 4, 2022 · 0 comments
Open

EditArtwork does not work with ImagePath #22

shaan-mephobic opened this issue Sep 4, 2022 · 0 comments

Comments

@shaan-mephobic
Copy link

Hi, It's been a long time!
EditArtwork function does not work with image path(it does work with FilePicker).

E/AndroidRuntime(26913): FATAL EXCEPTION: main
E/AndroidRuntime(26913): Process: com.Phoenix.project, PID: 26913
E/AndroidRuntime(26913): java.io.FileNotFoundException: : open failed: ENOENT (No such file or directory)
E/AndroidRuntime(26913):        at libcore.io.IoBridge.open(IoBridge.java:575)
E/AndroidRuntime(26913):        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:289)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.AndroidArtwork.setFromFile(AndroidArtwork.java:123)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.AndroidArtwork.createArtworkFromFile(AndroidArtwork.java:144)
E/AndroidRuntime(26913):        at org.jaudiotagger.tag.images.ArtworkFactory.createArtworkFromFile(ArtworkFactory.java:40)
E/AndroidRuntime(26913):        at com.lucasjosino.on_audio_edit.methods.edits.OnArtworkEdit10$doEverythingInBackground$2.invokeSuspend(OnArtworkEdit10.kt:122)
E/AndroidRuntime(26913):        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/AndroidRuntime(26913):        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
E/AndroidRuntime(26913):        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
E/AndroidRuntime(26913): Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
E/AndroidRuntime(26913):        at libcore.io.Linux.open(Native Method)
E/AndroidRuntime(26913):        at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
E/AndroidRuntime(26913):        at libcore.io.BlockGuardOs.open(BlockGuardOs.java:273)
E/AndroidRuntime(26913):        at libcore.io.ForwardingOs.open(ForwardingOs.java:567)
E/AndroidRuntime(26913):        at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7725)
E/AndroidRuntime(26913):        at libcore.io.IoBridge.open(IoBridge.java:561)
E/AndroidRuntime(26913):        ... 11 more
I/Process (26913): Sending signal. PID: 26913 SIG: 9
Lost connection to device.

This was the same case for both android 12 and android 9, except android 12 crashed completely but android 9 didn't.

I tried to dig through your code and found the issue.

What does findImage() do?
I tried passing the uri directly without findImage() like below and it worked on both android versions,

        val imageData = File(uri.toString())
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant