binary data

21 views
Skip to first unread message

cor

unread,
Feb 2, 2012, 5:59:23 PM2/2/12
to imgseek_users
Im developing some PHP code that hooks in image uploads with detection
of duplicates during upload. It works like a charm.

Im trying to change the code to use queryImgBlob and addImgBlob
(because the server will be detached from the apache server) but am
not having much luck. How exactly am I supposed to encode the blob? Im
currently basically doing this: (removed some code..just the
highlights)

$image = new Imagick($path);
$imgblob = $image->getImageBlob(); (this returns a string with binary
data)

$msg = new xmlrpcmsg('addImgBlob',
array(php_xmlrpc_encode(1), // dbID = 1
php_xmlrpc_encode($fileid), // img id
php_xmlrpc_encode($imgblob)
)
);

This is probably not correct, as this dumps binary data into the XML
request. But how am I supposed the encode the blob? It all works fine
with queryImg and addImg, but id love to change to using blobs.

regards,

cor

Ricardo Niederberger Cabral

unread,
Feb 7, 2012, 9:19:15 PM2/7/12
to imgsee...@googlegroups.com
Try using:

php_xmlrpc_encode(new xmlrpcval($imglob, 'base64'))

I don't know much PHP, I got this from http://phpxmlrpc.sourceforge.net/doc-2/ch09s02.html

Ricardo

> --
> You received this message because you are subscribed to the Google Groups "imgseek_users" group.
> To post to this group, send email to imgsee...@googlegroups.com.
> To unsubscribe from this group, send email to imgseek_user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/imgseek_users?hl=en.
>

Reply all
Reply to author
Forward
0 new messages