Java lang illegalargumentexception must be 64 pixels wide

Масштабирование пикселей изображения, ошибка: java.lang.IllegalArgumentException

Я пытаюсь манипулировать пикселями изображения, но он дает ошибку: java.lang.IllegalArgumentException: x must be < bitmap.width() Это мой код..

 Uri selectedImg = data.getData(); 
String[] filePathColumn = ;
Cursor cursor = getContentResolver().query(selectedImg, filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();

Toast.makeText(this, "Successfull!", Toast.LENGTH_LONG);
image = (ImageView)findViewById(R.id.imageView);
image.setImageBitmap(BitmapFactory.decodeFile(picturePath));
BitmapDrawable abmp = (BitmapDrawable) image.getDrawable();
bmp = abmp.getBitmap();
image.setImageBitmap(bmp);

brightBtn.setOnClickListener(new View.OnClickListener()

@Override
public void onClick(View v) operation = Bitmap.createBitmap(bmp.getWidth(), bmp.getHeight(), bmp.getConfig());

for (int i = 0; i < bmp.getWidth(); i++) for (int j = 0; j < bmp.getHeight(); i++) int p = bmp.getPixel(i, j);
int r = Color.red(p);
int b = Color.blue(p);
int g = Color.green(p);
int alpha = Color.alpha(p);

r = r + 100;
g = g + 100;
b = b = 100;
alpha = alpha + 100;

operation.setPixel(i, j, Color.argb(alpha, r, g, b));
>
>
image.setImageBitmap(operation);
>

>);

>
>

04 20:11:11.076 19366-19366/com.example..photoeditingapp E/AndroidRuntime: FATAL EXCEPTION: main
03-04 20:11:11.076 19366-19366/com.example..photoeditingapp E/AndroidRuntime: Process: com.example.zohair.photoeditingapp, PID: 19366
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: java.lang.IllegalArgumentException: x must be < bitmap.width()
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.graphics.Bitmap.checkPixelAccess(Bitmap.java:1449)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.graphics.Bitmap.getPixel(Bitmap.java:1401)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at com.example.zohair.photoeditingapp.MainActivity$3.onClick(MainActivity.java:95)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.view.View.performClick(View.java:4640)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.view.View$PerformClick.run(View.java:19425)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:733)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:95)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.os.Looper.loop(Looper.java:146)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5593)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
03-04 20:11:11.076 19366-19366/com.example.zohair.photoeditingapp E/AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
03-04 20:11:12.676 19366-19366/com.example.zohair.photoeditingapp I/Process: Sending signal. PID: 19366 SIG: 9

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

Can’t Use different Server-Icon.png sizes #38

Can’t Use different Server-Icon.png sizes #38

Comments

When you have a server-icon.png that is of different size from 64 pixels. This occurs. It doesn’t seem to happen on KCauldron or UraniumMC

java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[Validate.class:2.6]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:262) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:256) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadIcon(CraftServer.java:824) [CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.(CraftServer.java:236) [CraftServer.class:1.7.10-4.1]
at net.minecraft.server.management.ServerConfigurationManager.(ServerConfigurationManager.java:130) [oi.class:?]
at net.minecraft.server.dedicated.DedicatedPlayerList.(SourceFile:14) [ls.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:234) [lt.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:641) [MinecraftServer.class:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]
[18:55:12 WARN]: Couldn’t load server icon
java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[Validate.class:2.6]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:262) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadServerIcon0(CraftServer.java:256) ~[CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadIcon(CraftServer.java:824) [CraftServer.class:1.7.10-4.1]
at org.bukkit.craftbukkit.v1_7_R4.CraftServer.(CraftServer.java:240) [CraftServer.class:1.7.10-4.1]
at net.minecraft.server.management.ServerConfigurationManager.(ServerConfigurationManager.java:130) [oi.class:?]
at net.minecraft.server.dedicated.DedicatedPlayerList.(SourceFile:14) [ls.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:234) [lt.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:641) [MinecraftServer.class:?]

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

Minecraft Server Icon Error #2573

Minecraft Server Icon Error #2573

Comments

hy.
when i upload an image 64×64 with the name Server-Icon i get an error:

Couldn’t load server icon
java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[patched_1.15.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadServerIcon0(CraftServer.java:1877) ~[patched_1.15.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadServerIcon0(CraftServer.java:1865) ~[patched_1.15.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.loadIcon(CraftServer.java:937) ~[patched_1.15.2.jar:git-Paper-379]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.(CraftServer.java:323) ~[patched_1.15.2.jar:git-Paper-379]
at net.minecraft.server.v1_15_R1.PlayerList.(PlayerList.java:80) ~[patched_1.15.2.jar:git-Paper-379]
at net.minecraft.server.v1_15_R1.DedicatedPlayerList.(SourceFile:14) ~[patched_1.15.2.jar:git-Paper-379]
at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:183) ~[patched_1.15.2.jar:git-Paper-379]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:908) ~[patched_1.15.2.jar:git-Paper-379]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_262]

can anyone say why its doing that?

The text was updated successfully, but these errors were encountered:

Источник

Что тут не так?

[19:32:52] [Server thread/INFO]: Starting minecraft server version 1.8.8
[19:32:52] [Server thread/INFO]: Loading properties
[19:32:52] [Server thread/INFO]: Default game type: SURVIVAL
[19:32:53] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-5f38d38-18fbb24 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT)
[19:32:54] [Server thread/WARN]: Couldn’t load server icon
java.lang.IllegalArgumentException: Must be 64 pixels wide
at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadServerIcon0(CraftServer.java:1672) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadServerIcon0(CraftServer.java:1660) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadIcon(CraftServer.java:749) [server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.craftbukkit.v1_8_R3.CraftServer.(CraftServer.java:250) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.PlayerList.(PlayerList.java:71) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.DedicatedPlayerList.(SourceFile:14) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:176) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-5f38d38-18fbb24]at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101][19:32:54] [Server thread/INFO]: Using 8 threads for Netty based IO
[19:32:54] [Server thread/INFO]: Server Ping Player Sample Count: 12
[19:32:54] [Server thread/WARN]: *** WARNING *** stats.disable-saving is true but stats.forced-stats.achievement.openInventory isn’t set to 1. Disabling stat saving without forcing the achievement may cause it to get stuck on the player’s screen.
[19:32:54] [Server thread/INFO]: Debug logging is disabled
[19:32:55] [Server thread/INFO]: Generating keypair
[19:32:56] [Server thread/INFO]: Starting Minecraft server on 178.32.99.95:25944
[19:32:57] [Server thread/INFO]: Using epoll channel type
[19:32:58] [Server thread/INFO]: Set PluginClassLoader as parallel capable
[19:32:58] [Server thread/ERROR]: Could not load ‘plugins/LimitedWE.jar’ in folder ‘plugins’
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/sk89q/minecraft/util/commands/CommandException
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [server.jar:git-Spigot-5f38d38-18fbb24]at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [server.jar:git-Spigot-5f38d38-18fbb24]at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]Caused by: java.lang.NoClassDefFoundError: com/sk89q/minecraft/util/commands/CommandException
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_101]at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_101]at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:64) ~[server.jar:git-Spigot-5f38d38-18fbb24]at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[server.jar:git-Spigot-5f38d38-18fbb24]. 6 more
C

Читайте лог, раз уж решили сервера творить.

: Couldn’t load server icon
java.lang.IllegalArgumentException: Must be 64 pixels wide

Иконка сервера должна быть 64х64

Источник

Читайте также:  Html код страницы utf
Оцените статью