Subject Re: [firebird-support] Blob - Invalid segment size
Author Vlad Khorsun
> With larger images to save in blobs, IBPP is throwing exceptions
> with this text:
>
> Context: Blob::Write
> Message: Invalid segment size (max 64Kb-1)
>
> Documents I read suggests that the segment size of a blob is
> irrelevant.

Yes, this is almost correct.

> I defined a blob as:
>
> CON_IMAGE BLOB SUB_TYPE -3
>
> The sub type is my own enumerator, for graphic data.
>
> After this problem started I tried:
>
> CON_IMAGE BLOB SUB_TYPE -3 SEGMENT SIZE 25000
>
> And I also tried a size if 2500.
>
> I'm getting the same error.
>
> The code to write the blob looks like this:
>
> image_blob =
> IBPP::BlobFactory(
> database_record_ptr->get_database_id(),
> selected_transaction_ptr->transaction);
>
> image_blob->Create();
>
> image_blob->Write(image_buffer, image_size);

Try to Write image_buffer in loop using smaller chunks, say 64K-3.

Regards,
Vlad