Tue, 11 Oct 2016 23:32:23 -0500
rename purple_image_get_size to purple_image_get_data_size and deal with the fallout
--- a/libpurple/buddyicon.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/buddyicon.c Tue Oct 11 23:32:23 2016 -0500 @@ -510,7 +510,7 @@ if (icon->img) { if (len != NULL) - *len = purple_image_get_size(icon->img); + *len = purple_image_get_data_size(icon->img); return purple_image_get_data(icon->img); }
--- a/libpurple/image.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/image.c Tue Oct 11 23:32:23 2016 -0500 @@ -111,7 +111,7 @@ g_value_set_boxed(value, purple_image_get_contents(image)); break; case PROP_SIZE: - g_value_set_uint64(value, purple_image_get_size(image)); + g_value_set_uint64(value, purple_image_get_data_size(image)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); @@ -220,7 +220,7 @@ g_return_val_if_fail(path[0] != '\0', FALSE); data = purple_image_get_data(image); - len = purple_image_get_size(image); + len = purple_image_get_data_size(image); g_return_val_if_fail(data != NULL, FALSE); g_return_val_if_fail(len > 0, FALSE); @@ -256,7 +256,7 @@ } gsize -purple_image_get_size(PurpleImage *image) { +purple_image_get_data_size(PurpleImage *image) { PurpleImagePrivate *priv; g_return_val_if_fail(PURPLE_IS_IMAGE(image), 0); @@ -293,7 +293,7 @@ if (priv->extension) return priv->extension; - if (purple_image_get_size(image) < 4) + if (purple_image_get_data_size(image) < 4) return NULL; data = purple_image_get_data(image); @@ -360,7 +360,7 @@ ext = purple_image_get_extension(image); data = purple_image_get_data(image); - len = purple_image_get_size(image); + len = purple_image_get_data_size(image); g_return_val_if_fail(ext != NULL, NULL); g_return_val_if_fail(data != NULL, NULL); @@ -411,4 +411,4 @@ return purple_image_generate_filename(image); } - \ No newline at end of file +
--- a/libpurple/image.h Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/image.h Tue Oct 11 23:32:23 2016 -0500 @@ -164,14 +164,14 @@ const gchar *purple_image_get_path(PurpleImage *image); /** - * purple_image_get_size: + * purple_image_get_data_size: * @image: the image. * * Returns the size of @image's data. * * Returns: the size of data, or 0 in case of failure. */ -gsize purple_image_get_size(PurpleImage *image); +gsize purple_image_get_data_size(PurpleImage *image); /** * purple_image_get_data:
--- a/libpurple/log.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/log.c Tue Oct 11 23:32:23 2016 -0500 @@ -845,7 +845,7 @@ } image_data = purple_image_get_data(image); - image_byte_count = purple_image_get_size(image); + image_byte_count = purple_image_get_data_size(image); dir = purple_log_get_log_dir(log->type, log->name, log->account); new_filename = purple_image_generate_filename(image);
--- a/libpurple/protocols/bonjour/mdns_common.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/bonjour/mdns_common.c Tue Oct 11 23:32:23 2016 -0500 @@ -186,7 +186,7 @@ gsize avatar_len; avatar_data = purple_image_get_data(img); - avatar_len = purple_image_get_size(img); + avatar_len = purple_image_get_data_size(img); if (_mdns_set_buddy_icon_data(data, avatar_data, avatar_len)) { g_free(data->phsh);
--- a/libpurple/protocols/gg/avatar.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/gg/avatar.c Tue Oct 11 23:32:23 2016 -0500 @@ -354,7 +354,7 @@ own_data->img = NULL; img_data = purple_base64_encode(purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); img_data_e = g_uri_escape_string(img_data, NULL, FALSE); g_free(img_data); request_data = g_strdup_printf("uin=%d&photo=%s", uin, img_data_e);
--- a/libpurple/protocols/gg/image-prpl.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/gg/image-prpl.c Tue Oct 11 23:32:23 2016 -0500 @@ -104,7 +104,7 @@ g_return_val_if_fail(image, GGP_IMAGE_PREPARE_FAILURE); - image_size = purple_image_get_size(image); + image_size = purple_image_get_data_size(image); if (image_size > GGP_IMAGE_SIZE_MAX) { purple_debug_warning("gg", "ggp_image_prepare: image " @@ -206,7 +206,7 @@ gg_image_reply(accdata->session, image_request->sender, gg_filename, purple_image_get_data(sent_image->image), - purple_image_get_size(sent_image->image)); + purple_image_get_data_size(sent_image->image)); g_free(gg_filename); conv = purple_conversations_find_with_account(
--- a/libpurple/protocols/jabber/buddy.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/jabber/buddy.c Tue Oct 11 23:32:23 2016 -0500 @@ -474,7 +474,9 @@ if (image != NULL) { js->initial_avatar_hash = jabber_calculate_data_hash( purple_image_get_data(image), - purple_image_get_size(image), "sha1"); + purple_image_get_data_size(image), + "sha1" + ); g_object_unref(image); } else { js->initial_avatar_hash = NULL; @@ -514,7 +516,7 @@ } avatar_data = purple_image_get_data(img); - avatar_len = purple_image_get_size(img); + avatar_len = purple_image_get_data_size(img); /* Get rid of an old PHOTO if one exists. * TODO: This may want to be modified to remove all old PHOTO * children, at the moment some people have managed to get
--- a/libpurple/protocols/jabber/jabber.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/jabber/jabber.c Tue Oct 11 23:32:23 2016 -0500 @@ -1137,7 +1137,9 @@ if (image != NULL) { js->initial_avatar_hash = jabber_calculate_data_hash( purple_image_get_data(image), - purple_image_get_size(image), "sha1"); + purple_image_get_data_size(image), + "sha1" + ); g_object_unref(image); }
--- a/libpurple/protocols/jabber/message.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/jabber/message.c Tue Oct 11 23:32:23 2016 -0500 @@ -935,7 +935,7 @@ it_next = g_list_next(it); - if (purple_image_get_size(PURPLE_IMAGE(smiley)) > JABBER_DATA_MAX_SIZE) { + if (purple_image_get_data_size(PURPLE_IMAGE(smiley)) > JABBER_DATA_MAX_SIZE) { has_too_large_smiley = TRUE; valid = FALSE; purple_debug_warning("jabber", "Refusing to send " @@ -976,7 +976,7 @@ jdata = jabber_data_create_from_data( purple_image_get_data(PURPLE_IMAGE(smiley)), - purple_image_get_size(PURPLE_IMAGE(smiley)), + purple_image_get_data_size(PURPLE_IMAGE(smiley)), mimetype, FALSE, jm->js); purple_debug_info("jabber", "cache local smiley alt=%s, cid=%s",
--- a/libpurple/protocols/jabber/useravatar.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/jabber/useravatar.c Tue Oct 11 23:32:23 2016 -0500 @@ -130,7 +130,7 @@ } ihdr; } *png = NULL; - if (purple_image_get_size(img) > sizeof(*png)) + if (purple_image_get_data_size(img) > sizeof(*png)) png = purple_image_get_data(img); /* check if the data is a valid png file (well, at least to some extent) */ @@ -156,10 +156,10 @@ /* compute the sha1 hash */ char *hash = jabber_calculate_data_hash( purple_image_get_data(img), - purple_image_get_size(img), "sha1"); + purple_image_get_data_size(img), "sha1"); char *base64avatar = purple_base64_encode( purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); publish = purple_xmlnode_new("publish"); purple_xmlnode_set_attrib(publish, "node", NS_AVATAR_1_1_DATA); @@ -177,7 +177,7 @@ g_free(base64avatar); lengthstring = g_strdup_printf("%" G_GSIZE_FORMAT, - purple_image_get_size(img)); + purple_image_get_data_size(img)); widthstring = g_strdup_printf("%u", width); heightstring = g_strdup_printf("%u", height);
--- a/libpurple/protocols/msn/object.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/msn/object.c Tue Oct 11 23:32:23 2016 -0500 @@ -141,7 +141,7 @@ if (img == NULL) return NULL; - size = purple_image_get_size(img); + size = purple_image_get_data_size(img); data = purple_image_get_data(img); /* New object */
--- a/libpurple/protocols/msn/slp.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/msn/slp.c Tue Oct 11 23:32:23 2016 -0500 @@ -212,7 +212,7 @@ if (my_obj != NULL) { PurpleImage *img = msn_object_get_image(my_obj); data = purple_image_get_data(img); - len = purple_image_get_size(img); + len = purple_image_get_data_size(img); info = msn_object_get_sha1(my_obj); }
--- a/libpurple/protocols/msn/slpmsg.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/msn/slpmsg.c Tue Oct 11 23:32:23 2016 -0500 @@ -125,7 +125,7 @@ g_return_if_fail(slpmsg->buffer == NULL); g_return_if_fail(slpmsg->ft == FALSE); - slpmsg->size = purple_image_get_size(img); + slpmsg->size = purple_image_get_data_size(img); slpmsg->buffer = g_memdup(purple_image_get_data(img), slpmsg->size); }
--- a/libpurple/protocols/mxit/markup.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/mxit/markup.c Tue Oct 11 23:32:23 2016 -0500 @@ -1044,7 +1044,7 @@ gchar* enc; img_data = purple_image_get_data(image); - img_size = purple_image_get_size(image); + img_size = purple_image_get_data_size(image); enc = purple_base64_encode( img_data, img_size );
--- a/libpurple/protocols/mxit/mxit.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/mxit/mxit.c Tue Oct 11 23:32:23 2016 -0500 @@ -544,7 +544,7 @@ mxit_set_avatar(session, NULL, 0); else { mxit_set_avatar(session, purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); } }
--- a/libpurple/protocols/oscar/family_oservice.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/oscar/family_oservice.c Tue Oct 11 23:32:23 2016 -0500 @@ -928,7 +928,7 @@ "Uploading icon to icon server\n"); aim_bart_upload(od, purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); g_object_unref(img); } }
--- a/libpurple/protocols/oscar/oscar.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/oscar/oscar.c Tue Oct 11 23:32:23 2016 -0500 @@ -1422,7 +1422,7 @@ if ((img != NULL) && (args->icbmflags & AIM_IMFLAGS_BUDDYREQ) && !bi->ico_sent && bi->ico_informed) { gconstpointer data = purple_image_get_data(img); - size_t len = purple_image_get_size(img); + size_t len = purple_image_get_data_size(img); purple_debug_info("oscar", "Sending buddy icon to %s (%" G_GSIZE_FORMAT " bytes)\n", userinfo->bn, len); @@ -2546,7 +2546,7 @@ purple_debug_info("oscar", "Uploading icon to icon server"); aim_bart_upload(od, purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); g_object_unref(img); } od->set_icon = FALSE; @@ -3057,7 +3057,7 @@ /* ... if it refers to a valid purple image ... */ if (image) { /* ... append the message from start to the tag ... */ - unsigned long size = purple_image_get_size(image); + unsigned long size = purple_image_get_data_size(image); const gchar *filename = purple_image_get_friendly_filename(image); gconstpointer imgdata = purple_image_get_data(image); @@ -3205,7 +3205,7 @@ img = purple_buddy_icons_find_account_icon(account); if (img) { gconstpointer data = purple_image_get_data(img); - args.iconlen = purple_image_get_size(img); + args.iconlen = purple_image_get_data_size(img); args.iconsum = aimutil_iconsum(data, args.iconlen); args.iconstamp = purple_buddy_icons_get_account_icon_timestamp(account); @@ -5241,7 +5241,7 @@ PurpleHash *hash; guchar md5[16]; gconstpointer data = purple_image_get_data(img); - size_t len = purple_image_get_size(img); + size_t len = purple_image_get_data_size(img); hash = purple_md5_hash_new(); purple_hash_append(hash, data, len);
--- a/libpurple/protocols/sametime/sametime.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/sametime/sametime.c Tue Oct 11 23:32:23 2016 -0500 @@ -3878,7 +3878,7 @@ /* obtain and base64 encode the image data, and put it in the mime part */ - size = purple_image_get_size(img); + size = purple_image_get_data_size(img); data = purple_base64_encode(purple_image_get_data(img), size); purple_mime_part_set_data(part, data); g_free(data);
--- a/libpurple/protocols/silc/buddy.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/silc/buddy.c Tue Oct 11 23:32:23 2016 -0500 @@ -1751,7 +1751,7 @@ silc_mime_add_field(mime, "Content-Type", type); silc_mime_add_data(mime, purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); silc_client_attribute_add(client, conn, SILC_ATTRIBUTE_USER_ICON, mime, sizeof(*mime));
--- a/libpurple/protocols/silc/util.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/silc/util.c Tue Oct 11 23:32:23 2016 -0500 @@ -623,7 +623,7 @@ if (uri) image = purple_image_store_get_from_uri(uri); if (uri) { - unsigned long imglen = purple_image_get_size(image); + unsigned long imglen = purple_image_get_data_size(image); gconstpointer img = purple_image_get_data(image); const gchar *type;
--- a/libpurple/protocols/yahoo/yahoo_picture.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/protocols/yahoo/yahoo_picture.c Tue Oct 11 23:32:23 2016 -0500 @@ -489,7 +489,7 @@ } else { gconstpointer data = purple_image_get_data(img); - size_t len = purple_image_get_size(img); + size_t len = purple_image_get_data_size(img); GString *s = g_string_new_len(data, len); struct yahoo_buddy_icon_upload_data *d; int oldcksum = purple_account_get_int(account, YAHOO_PICCKSUM_SETTING, 0);
--- a/libpurple/smiley-custom.c Tue Oct 04 19:59:05 2016 -0500 +++ b/libpurple/smiley-custom.c Tue Oct 11 23:32:23 2016 -0500 @@ -175,7 +175,7 @@ return g_compute_checksum_for_data(G_CHECKSUM_SHA1, purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); }
--- a/pidgin/gtkaccount.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkaccount.c Tue Oct 11 23:32:23 2016 -0500 @@ -735,7 +735,7 @@ img = purple_buddy_icons_find_account_icon(dialog->account); if (img) { - len = purple_image_get_size(img); + len = purple_image_get_data_size(img); data = g_memdup(purple_image_get_data(img), len); } set_dialog_icon(dialog, data, len, @@ -1374,7 +1374,7 @@ { if (dialog->icon_img) { - size_t len = purple_image_get_size(dialog->icon_img); + size_t len = purple_image_get_data_size(dialog->icon_img); purple_buddy_icons_set_account_icon(account, g_memdup(purple_image_get_data(dialog->icon_img), len), len); purple_account_set_buddy_icon_path(account,
--- a/pidgin/gtkblist.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkblist.c Tue Oct 11 23:32:23 2016 -0500 @@ -2702,7 +2702,7 @@ if (custom_img) { data = purple_image_get_data(custom_img); - len = purple_image_get_size(custom_img); + len = purple_image_get_data_size(custom_img); } if (data == NULL) { @@ -2725,7 +2725,7 @@ account ? purple_account_get_username(account) : "(no account)", account ? purple_account_get_protocol_id(account) : "(no account)", buddy ? purple_buddy_get_name(buddy) : "(no buddy)", - custom_img ? purple_image_get_size(custom_img) : 0); + custom_img ? purple_image_get_data_size(custom_img) : 0); if (custom_img) g_object_unref(custom_img); return NULL;
--- a/pidgin/gtkconv.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkconv.c Tue Oct 11 23:32:23 2016 -0500 @@ -7861,7 +7861,7 @@ if (custom_img) { /* There is a custom icon for this user */ data = purple_image_get_data(custom_img); - len = purple_image_get_size(custom_img); + len = purple_image_get_data_size(custom_img); } } }
--- a/pidgin/gtkstatusbox.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkstatusbox.c Tue Oct 11 23:32:23 2016 -0500 @@ -2191,12 +2191,12 @@ g_signal_connect(G_OBJECT(loader), "size-prepared", G_CALLBACK(pixbuf_size_prepared_cb), NULL); if (!gdk_pixbuf_loader_write(loader, purple_image_get_data(status_box->buddy_icon_img), - purple_image_get_size(status_box->buddy_icon_img), + purple_image_get_data_size(status_box->buddy_icon_img), &error) || error) { purple_debug_warning("gtkstatusbox", "gdk_pixbuf_loader_write() failed with size=%" - G_GSIZE_FORMAT ": %s", purple_image_get_size( + G_GSIZE_FORMAT ": %s", purple_image_get_data_size( status_box->buddy_icon_img), error ? error->message : "(no error message)"); if (error) @@ -2205,7 +2205,7 @@ purple_debug_warning("gtkstatusbox", "gdk_pixbuf_loader_close() failed for image of " "size %" G_GSIZE_FORMAT ": %s", - purple_image_get_size(status_box->buddy_icon_img), + purple_image_get_data_size(status_box->buddy_icon_img), error ? error->message : "(no error message)"); if (error) g_error_free(error);
--- a/pidgin/gtkutils.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkutils.c Tue Oct 11 23:32:23 2016 -0500 @@ -3101,7 +3101,7 @@ pidgin_pixbuf_from_image(PurpleImage *image) { return pidgin_pixbuf_from_data(purple_image_get_data(image), - purple_image_get_size(image)); + purple_image_get_data_size(image)); } GdkPixbuf *pidgin_pixbuf_new_from_file(const gchar *filename)
--- a/pidgin/gtkwebview.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/gtkwebview.c Tue Oct 11 23:32:23 2016 -0500 @@ -206,7 +206,7 @@ b64 = purple_base64_encode( purple_image_get_data(img), - purple_image_get_size(img)); + purple_image_get_data_size(img)); type = purple_image_get_mimetype(img); src = g_strdup_printf("data:%s;base64,%s", type, b64); g_free(b64);
--- a/pidgin/plugins/imgupload.c Tue Oct 04 19:59:05 2016 -0500 +++ b/pidgin/plugins/imgupload.c Tue Oct 11 23:32:23 2016 -0500 @@ -122,7 +122,7 @@ /* TODO: make it a plain, multipart/form-data request */ img_data = purple_base64_encode(purple_image_get_data(image), - purple_image_get_size(image)); + purple_image_get_data_size(image)); img_data_e = g_uri_escape_string(img_data, NULL, FALSE); g_free(img_data); req_data = g_strdup_printf("type=base64&image=%s", img_data_e);