[pull] master from libvips:master#53
Merged
pull[bot] merged 2 commits intoadmariner:masterfrom Jun 2, 2025
Merged
Conversation
Reviewer's GuideThis PR introduces a buffer-based PPM loader and refactors all foreign load/save classes to streamline their build methods by delegating directly to parent class build, along with updating C++ bindings, docs, and tests to support the new API. Sequence Diagram for vips_ppmload_buffer OperationsequenceDiagram
actor ClientApp as "Client Application"
participant C_API as "vips_ppmload_buffer()"
participant CoreOp as "ppmload_buffer Operation Core"
participant BufferLoader as "VipsForeignLoadPpmBuffer"
participant ParentBuild as "VipsForeignLoadPpm.build()"
participant VipsSourceLib as "VipsSource Library"
ClientApp->>C_API: Call vips_ppmload_buffer(buffer_ptr, len, &out_image)
C_API->>C_API: Create VipsBlob from buffer_ptr, len
C_API->>CoreOp: vips_call_split("ppmload_buffer", blob, &out_image)
CoreOp->>BufferLoader: vips_foreign_load_ppm_buffer_build(self)
activate BufferLoader
BufferLoader->>VipsSourceLib: vips_source_new_from_memory(blob_data, blob_length)
VipsSourceLib-->>BufferLoader: new VipsSource
BufferLoader->>ParentBuild: Call parent_class->build(self)
activate ParentBuild
ParentBuild-->>BufferLoader: build_result (image data read via VipsSource)
deactivate ParentBuild
BufferLoader-->>CoreOp: build_result
deactivate BufferLoader
CoreOp-->>C_API: result (image loaded)
C_API->>C_API: vips_area_unref(VipsBlob)
C_API-->>ClientApp: Return 0 (success) or -1 (error)
Class Diagram for New PPM Buffer Loading FunctionalityclassDiagram
direction TB
class VipsForeignLoadPpm {
<<Base Class for PPM Loading>>
# VipsSource* source
# build(VipsObject* object) int
}
class VipsForeignLoadPpmBuffer {
+ VipsBlob* blob
+ vips_foreign_load_ppm_buffer_build(VipsObject* object) int
+ vips_foreign_load_ppm_is_a_buffer(const void* buf, size_t len) gboolean
+ vips_foreign_load_ppm_buffer_class_init(VipsForeignLoadPpmBufferClass* class) void
+ vips_foreign_load_ppm_buffer_init(VipsForeignLoadPpmBuffer* buffer) void
}
VipsForeignLoadPpm <|-- VipsForeignLoadPpmBuffer
class VipsBlob {
+ void* data
+ size_t length
}
VipsForeignLoadPpmBuffer *-- "1" VipsBlob : "loads_from"
class PublicAPI {
<<API Entry Points>>
+ vips_ppmload_buffer(void* buf, size_t len, VipsImage** out, ...) int
+ VImage VImage::ppmload_buffer(VipsBlob* buffer, VOption* options)
}
PublicAPI ..> VipsForeignLoadPpmBuffer : invokes
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )
Summary by Sourcery
Introduce a buffer-based loader for PPM images and unify foreign build function implementations by returning parent class build results directly.
New Features:
Enhancements:
Documentation:
Tests: