{"record":{"id":"b3657449c4c3f9c0","repo":"bevyengine/bevy","slug":"can-not-evenly-divide-grid-with-width-width-by","errorCode":null,"errorMessage":"can not evenly divide grid with width = {width} by tiles = {tile_count_x}","messagePattern":"can not evenly divide grid with width = (.+?) by tiles = (.+?)","errorType":"exception","errorClass":"TextureReinterpretationError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/image.rs","lineNumber":2253,"sourceCode":"    /// The grid width is not divisible by the number of tiles in the width.\n    #[error(\"can not evenly divide grid with width = {width} by tiles = {tile_count_x}\")]\n    GridWidthNotDivisibleByTileWidth {\n        /// The total image height in pixels.\n        width: u32,\n        /// The desired number of image layers.\n        tile_count_x: u32,\n    },\n    /// The texture format is not supported.\n    #[error(\"Cannot process texture in its current format. Is it compressed?\")]\n    InvalidTextureFormat,\n}\n\n/// An error that occurs when accessing specific pixels in a texture.\n#[derive(Error, Debug)]\npub enum TextureAccessError {\n    /// Attempted to access a pixel outside the texture bounds.\n    #[error(\"out of bounds (x: {x}, y: {y}, z: {z})\")]\n    OutOfBounds {\n        /// The pixel x-coordinate.\n        x: u32,\n        /// The pixel y-coordinate.\n        y: u32,\n        /// The pixel z-coordinate.\n        z: u32,\n    },\n    /// Attempted to perform an image operation on an unsupported texture format.\n    ///\n    /// Most often this is returned when attempting to access pixel data of compressed textures.\n    #[error(\"unsupported texture format: {0:?}\")]\n    UnsupportedTextureFormat(TextureFormat),\n    /// Attempted to access the data of an image before it was initialized, or after it was moved\n    /// to the GPU.\n    ///\n    /// See [`RenderAssetUsages`] for more information about when an asset's data is moved, and\n    /// how to retain it if necessary.\n    #[error(\"image data is not initialized\")]","sourceCodeStart":2235,"sourceCodeEnd":2271,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_image/src/image.rs#L2235-L2271","documentation":"Returned by ImageError::GridWidthNotDivisibleByTileWidth when splitting an image into a grid of tiles: the grid width in pixels is not evenly divisible by the number of tile columns, so tiles would have fractional widths.","triggerScenarios":"Thrown at crates/bevy_image/src/image.rs:2236 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change tile_count_x so it evenly divides the grid width","Adjust the image width to a multiple of the tile column count","Use a different slicing layout that matches the image dimensions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}