Comments (2)
this was never closed...so just offering more advice.
create a public static boolean method to check the image file extension before its being uploaded & if it returns true then continue on in the process..however if it returns false...issue a toast or dialog message stating its the wrong file...but...if the file can be converted beforehand I think that would be a better option.
such as: very rough example & can be better
(i would suggest to use an asynctask)
public static void convert2PNG(filename){
try {
FileOutputStream out = new FileOutputStream(filename);
bmp.compress(Bitmap.CompressFormat.PNG, 100, out); //100-best quality
out.close();
} catch (Exception e) {
e.printStackTrace();
}
}
//is image a png?
public static boolean isPNG(File file/String string){
File f = new File(file);
String s = string;
String ext = f.getAbsolutePath().substring(f.getAbsolutePath().lastIndexOf("."));
//or
String ext = s.substring(s.lastIndexOf("."));
if(ext.equalsIgnoreCase("png"){
return true;
}else{
return false;
}
if you allow users to use their own banners/logos then you should convert the images to PNG to make it easier for your users & speed up the process even further if they downloaded the wrong format.
from tvapprepo.
This was meant more for my own generating mechanism. Since we've moved away from that, this can be closed without fix
from tvapprepo.
Related Issues (20)
- DTV APP
- Add option to force screen orientation HOT 1
- Build failed
- Sharp Security
- web bookmark rename HOT 1
- Add option to open a web shortcut in fullscreen / immersive mode HOT 1
- Load banner from local image
- TvDeDe. (Plusdede for SmartTV)
- crashes on new shield tv HOT 26
- HBO Go
- Cipher TV
- nzb360 - App crashed while building launcher-app HOT 2
- The app doesn't properly on android 8.0 Oreo HOT 16
- tv app repo
- chrome
- Maintenance and Google Play HOT 1
- TvAppRepo Can't Load Android Game HOT 1
- Not working with Mi Box S, Android TV 9 (Official) HOT 5
- Could this be used to open a app and send a https get silently
- Web access stops working, after wifi reconnect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tvapprepo.