GitHub: Binary assets (e.g. Images) corrupted when saved to GitHub

I have a GitHub repo with access configured for AI Studio via the Google AI Studio integration. I edit and preview my code in AI Studio, then save it to GitHub directly from within AI Studio.

My project has some binary files in it (PNG images). They load and render fine within AI Studio, but when I commit them to GitHub, they are corrupted and are unparseable by the browser. If I upload the same files directly to GitHub, then they appear normally. I don’t have any image optimization or processing turned on (that I know of) in my build.

Further, once I upload the image manually into GitHub, AI Studio detects a difference and re-syncs all its assets next time I save, corrupting them again. So I’d have to do this step every time I want to deploy, which is not sustainable.

To illustrate, here’s a test image, then below I’ll paste the raw text output from the file that ends up in GitHub (the image file uploader refuses to parse it so I can’t upload it as an image.)

File that ends up in GitHub after I save from AI studio:

 PNG

   
IHDR           <q    	pHYs  
  
      gAMA    | Q     cHRM  z%              u0   `  :   o _ F   IDATx b   ? (   4     F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &    D bdd  b  IC    4 T	     #4A
Y    P 
T       e m o i  h }   h 4 4  FM @  & Q@ @ 	k   h 4 4  e .e       say\ , a Y{(tw( lt  h     @   b :n `  O.' <%  M y uJ$ ט  = ?    mU 4rM eH  >c  M   D 
 o H 
 i &*Pd F I 
R  P     d i@  ~   ۔        O c    d   *KCK  В X     ,     ~  VȠh ,, S    h   X .D     .8 
B 1  i    3      `  4 4  hz %.%,   ԼÕh  ;   pNX 4  Xi U
Г DꭀVg  c` \ 2
O 	 ` 0  nX  6	
ڶ
E $ I   4
|2 :{  yخ5  Tba4vI b"'A""ߘH AnY
-ÀX(vv &,  bF~A    LC  Y  2%>b	PM   4    Y, xt + a @  &,Lp @ Z   5   Bw (  @â*F$  4 I[b >>h 4   a   
   &B     hX c    1.u 3@3   ,  F c  A% +	 - 3 
ZU   @  &, h= 	  U| , -6G =l @  c  S
 vBK" AZl Vj     a    Jg @
 YH3    OA  Ք \     KUxKO x 4   V    a   a  p   &2X ֨     S =qѼ " T   *  1,W9  pJXg Q  
C VA .HrJ hm<hl     #  pNX dN      v {(  "   ۵  h8%,l I    1 a
  (z p! |%b:   PJX D { t Ii t `  % :Dw {J !5 
@ 9a ' ̈́m  *b   ~ ,;ރ% ga        4    $4  6   e  з
 > F r<ep Q¡   *< A	 Nj  `   	
[d =
ێ m 3 "   x ʀ ~9> C *Z  `   	+ @  &p  ;   $s    i    hpozĝ   CāwɈ  7    h@ =a	2 9ͅH  D ^  i @Kb ;O       A
  :    $  %կ   0 [   h 64  E  W    АHX `   ]A:
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	  ф5
h h4a     MX  &   F ( 	 0  T /     IEND B` 

Yes. i have the same issue.

Any update? Still having the same problem.

Any Update ?? .. It’s a basic functionality… :frowning:
I added my comments in this github issue: PNG files uploaded from Google AI Studio are corrupted when synced to GitHub · Issue #35 · google-gemini/aistudio-repository-template · GitHub

I have the same issue. I tried zipping a copy of the images and letting that unpack during build on Vercel, but EVEN THAT zip got mangled. I mean… how?

I also tried changing the .gitattributes or using LFS but to no avail.

We have the same issue, basically every picture can’t upload from AI Studio, it corrupt all the same way in different project.

Hi

I am looking into this and working on debugging it . I will share an update here soon

Same thing happens to me, any jpeg or png i use gets corrupt when synced to github.

The issue persists.
Silly me thought that editing the gitignore and manually uploading the images to the repo would work as a workaround, but AI Studio export function ignored the gitignore it seems. :sweat_smile:

It’s insane to me that this is still a problem. I Can’t make changes without every png/webm on my repository is corrupted by passing the changes on google ai studio? are the devs even watching? This is a major issue.