{"record":{"id":"724141746e1036ed","repo":"bevyengine/bevy","slug":"texture-access-error-0-724141","errorCode":null,"errorMessage":"texture access error: {0}","messagePattern":"texture access error: (.+?)","errorType":"exception","errorClass":"TextureAtlasBuilderError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/texture_atlas_builder.rs","lineNumber":31,"sourceCode":"use crate::{TextureAtlasLayout, TextureAtlasSources};\n\n/// Errors returned by [`TextureAtlasBuilder`].\n#[derive(Debug, Error)]\npub enum TextureAtlasBuilderError {\n    /// The atlas texture wasn't large enough to fit the texture\n    #[error(\"could not pack textures into an atlas within the given bounds\")]\n    NotEnoughSpace,\n    /// Attempted to add a texture with a different format\n    #[error(\"added a texture with the wrong format in an atlas\")]\n    WrongFormat,\n    /// Attempted to add a texture to an uninitialized atlas\n    #[error(\"cannot add texture to uninitialized atlas texture\")]\n    UninitializedAtlas,\n    /// Attempted to add an uninitialized texture to an atlas\n    #[error(\"cannot add uninitialized texture to atlas\")]\n    UninitializedSourceTexture,\n    /// A texture access error occurred\n    #[error(\"texture access error: {0}\")]\n    TextureAccess(#[from] TextureAccessError),\n}\n\n#[derive(Debug)]\n#[must_use]\n/// A builder which is used to create a texture atlas from many individual\n/// sprites.\npub struct TextureAtlasBuilder<'a> {\n    /// Collection of texture's asset id (optional) and image data to be packed into an atlas\n    textures_to_place: Vec<(Option<AssetId<Image>>, &'a Image)>,\n    /// The initial atlas size in pixels.\n    initial_size: UVec2,\n    /// The absolute maximum size of the texture atlas in pixels.\n    max_size: UVec2,\n    /// The texture format for the textures that will be loaded in the atlas.\n    format: TextureFormat,\n    /// Enable automatic format conversion for textures if they are not in the atlas format.\n    auto_format_conversion: bool,","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/texture_atlas_builder.rs#L13-L49","documentation":"Wrapper variant: an inner TextureAccessError occurred while reading the pixel data of an image being added to the atlas (e.g. out-of-bounds access while copying its region). The underlying error is the payload.","triggerScenarios":"Thrown at crates/bevy_image/src/texture_atlas_builder.rs:31 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the underlying TextureAccessError (e.g. out-of-bounds access or unsupported texture format)","Inspect the wrapped error to identify the failing access and correct the image or access pattern"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}