Error uploading animated GIF

1,108 views
Skip to first unread message

DavidR

unread,
Aug 7, 2009, 12:07:25 PM8/7/09
to AdWords API Forum
I'm trying to upload animated GIFs as an image ad using a PERL script.
The script works fine when I upload static gifs and jpegs but fails on
animated gifs. The message I receive is "This image could not be
recognized". I can upload the same animated GIF using the AdWords web
interface without a problem.

I'm using the PERL MIME::Base64 module to encode my images (same as in
the Adwords sample code for adding an image ad).

Is there a known problem with animated GIFs and the API? Or maybe I'm
doing something wrong?

David

AdWords API Advisor

unread,
Aug 7, 2009, 2:06:30 PM8/7/09
to AdWords API Forum
Hello David,

Could you pass along the value of the requestId SOAP response header
associated with the SOAP fault you're getting back? If you turn on
logging of your SOAP requests and responses you should be able to grab
this value from your logs.

Cheers,
-Jeff Posnick, AdWords API Team

DavidR

unread,
Aug 10, 2009, 11:48:44 AM8/10/09
to AdWords API Forum
>  Could you pass along the value of the requestId SOAP response header
> associated with the SOAP fault you're getting back?

The requestid is dca5d38d414b4eb7bfda57e3034c4f4e

David

AdWords API Advisor

unread,
Aug 10, 2009, 12:14:57 PM8/10/09
to AdWords API Forum
Hello David,

As far as I know, animated GIFs should be acceptable in general.
However, when I took a look at the image form our logs and tried
adding it to a test campaign using the normal AdWords web interface,
it was also flagged as being an unrecognized image. It also doesn't
look like a proper animated GIF when I view it directly in a web
browser--there's no animation, and the bottom of the image is
pixelated.

Can you try manually adding your original animated GIF to a paused ad
group using the AdWords web interface and see if it's recognized as
being a valid image ad? If it is recognized, then something is
happening to corrupt your image in the SOAP request. If it's not
recognized, then you just need to make sure that your source animated
GIF is created properly.

Cheers,
-Jeff Posnick, AdWords API Team


DavidR

unread,
Aug 10, 2009, 12:56:33 PM8/10/09
to AdWords API Forum

>  Can you try manually adding your original animated GIF to a paused ad
> group using the AdWords web interface and see if it's recognized as
> being a valid image ad? If it is recognized, then something is
> happening to corrupt your image in the SOAP request. If it's not
> recognized, then you just need to make sure that your source animated
> GIF is created properly.

Yes, I just uploaded it again using the web interface and it worked
fine. The AdWords system
correctly identified the image as a 468 x 60 animaged gif and when I
view it
through AdWords, I can see the image animation. There's no issue with
pixelation.

The Perl command I'm using to encode the image data is $image_encoded
= encode_base64(join('',<IMAGE>))
and this works fine for static images (it's taken directly from the
AdWords API sample code).

david

AdWords API Advisor

unread,
Aug 12, 2009, 4:31:49 PM8/12/09
to AdWords API Forum
Hello David,

Would you mind passing along the ad group id of the test ad group
that you uploaded to? I want to compare the decoded GIF file I get
from the logs with the actual GIF file that you uploaded.

The decoded GIF file I retrieved is 468 x 60, but as I said there's
some noise at the bottom and it appears to be a truncated version of a
larger file.

Cheers,
-Jeff Posnick, AdWords API Team


DavidR

unread,
Aug 12, 2009, 6:41:39 PM8/12/09
to AdWords API Forum

>  Would you mind passing along the ad group id of the test ad group
> that you uploaded to?

The id is 229704188

The image has been deleted. The name is "tester 1". Hopefully you can
still retrieve it.

thanks.

David

DavidR

unread,
Aug 18, 2009, 11:46:24 AM8/18/09
to AdWords API Forum
Hi Jeff, just wondering if this issue is on the radar. If it's just my
problem, I can
try to run with it on my own. David

AdWords API Advisor

unread,
Aug 18, 2009, 4:41:48 PM8/18/09
to AdWords API Forum
Hello David,

Sorry again about the delay. I was able to pull the version of the
image ad that's in ad group id 229704188 and compared it to what we
have in our logs from your request. It's size is 16512 bytes (base 64
encoded it is 22306 bytes) and the image that you uploaded via the API
is 16511 bytes (22305 bytes when base 64 encoded). There is a
significant different between the last couple of hundred bytes in each
file.

Based on that, I'd strongly suspect that something is going awry in
the Perl code you're using to read that GIF file in from disk--it
appears to be truncating the file by one byte, and getting the last
few hundred bytes incorrect. Alternatively, there could be something
going on to corrupt things during the transmission, but the fact that
the rest of the SOAP message is uncorrupted makes that less likely.

I do think that the API is correct in rejecting this GIF file, as
it's corrupt by the time it's received. I'm not entirely sure what
guidance to give, other than to try performing some sanity checks on
your end in which you try reading in the file and outputting the base
64 encoded version locally, and comparing that to the known "good"
version of the file.

Cheers,
-Jeff Posnick, AdWords API Team


Reply all
Reply to author
Forward
0 new messages