Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use glide for big video file? #2240

Closed
mengtrue opened this issue Aug 12, 2017 · 3 comments
Closed

How to use glide for big video file? #2240

mengtrue opened this issue Aug 12, 2017 · 3 comments
Labels
Milestone

Comments

@mengtrue
Copy link

Glide Version: glide:4.0.0-RC0
Integration libraries: None
Device/Android Version: Android 7.1
Issue details / Repro steps / Use case background:
There is big video (mp4) file, over 2.2G, I use glide to get thumbnail, it cause exception.

Glide load line / GlideModule (if any) / list Adapter code (if any):
compile 'com.github.bumptech.glide:glide:4.0.0-RC0'
I do not use GlideModule
Bitmap thumbnail = null;
thumbnail =
Glide.with(context)
.asBitmap()
.apply(
new RequestOptions()
.override(request.getWidth(), request.getHeight())
.centerCrop())
.load(filePath)
.submit(request.getWidth(), request.getHeight())
.get();

Stack trace / LogCat:

08-12 18:53:27.629 2438 4317 E GlideExecutor: java.lang.IllegalArgumentException: Size exceeds Integer.MAX_VALUE
08-12 18:53:27.629 2438 4317 E GlideExecutor: at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:850)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.util.ByteBufferUtil.fromFile(ByteBufferUtil.java:31)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.model.ByteBufferFileLoader$ByteBufferFetcher.loadData(ByteBufferFileLoader.java:59)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:61)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:275)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:245)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:220)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at java.lang.Thread.run(Thread.java:761)
08-12 18:53:27.629 2438 4317 E GlideExecutor: at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:347)

@sjudd sjudd added the bug label Aug 14, 2017
@sjudd sjudd added this to the 4.1 milestone Aug 14, 2017
@sjudd
Copy link
Collaborator

sjudd commented Aug 14, 2017

Can you reproduce this on multiple devices or versions of Android? Or only one particular device/version of Android?

The code in our control uses longs for file size, it looks there's some internal cast from long to int in the framework code.

@sjudd
Copy link
Collaborator

sjudd commented Aug 14, 2017

@sjudd sjudd closed this as completed in 8fac123 Aug 14, 2017
@mengtrue
Copy link
Author

mengtrue commented Aug 16, 2017

Hi, sjudd,
In FileChannelImpl.map, it will check size.
If size > Integer.MAX_VALUE, it will throw exception.
It's android source code, so it can not change.
So if we want to get thumbnail for one file (ove 2GB file), how can I do?

moved to #2252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants