Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Miscellany
Monday, December 10th, 2007 at 12:36:12am UTC 

  1. Index: apps/plugins/pictureflow.c
  2. ===================================================================
  3. --- apps/plugins/pictureflow.c  (rĂ©vision 15900)
  4. +++ apps/plugins/pictureflow.c  (copie de travail)
  5. @@ -533,10 +533,15 @@
  6.          int ret;
  7.          input_bmp.data = (char *) &input_bmp_buffer;
  8.          ret = rb->read_bmp_file(tmp_path_name, &input_bmp, sizeof(input_bmp_buffer), FORMAT_NATIVE);
  9. -        if (ret <= 0) continue; /* skip missing/broken files */
  10. +        if (ret <= 0) {
  11. +            rb->splash(HZ, "couldn't read bmp");
  12. +            continue; /* skip missing/broken files */
  13. +        }
  14.  
  15.          rb->snprintf(tmp_path_name, sizeof(tmp_path_name), CACHE_PREFIX "/%d.pfraw", i);
  16. -        create_bmp(&input_bmp, tmp_path_name);
  17. +        if (!create_bmp(&input_bmp, tmp_path_name)) {
  18. +            rb->splash(HZ, "couldn't write bmp");
  19. +        }
  20.          if ( rb->button_get(false) == PICTUREFLOW_MENU ) return false;
  21.      }
  22.      int fh = rb->creat( CACHE_PREFIX "/ready"  );
  23. @@ -720,13 +725,13 @@
  24.  /**
  25.   Safe the given bitmap as filename in the pfraw format
  26.   */
  27. -int save_pfraw(char* filename, struct bitmap *bm)
  28. +bool save_pfraw(char* filename, struct bitmap *bm)
  29.  {
  30.      struct pfraw_header bmph;
  31.      bmph.width = bm->width;
  32.      bmph.height = bm->height;
  33.      int fh = rb->creat( filename );
  34. -    if( fh < 0 ) return -1;
  35. +    if( fh < 0 ) return false;
  36.      rb->write( fh, &bmph, sizeof( struct pfraw_header ) );
  37.      int y;
  38.      for( y = 0; y < bm->height; y++ )
  39. @@ -735,7 +740,7 @@
  40.          rb->write( fh, d, sizeof( fb_data ) * bm->width );
  41.      }
  42.      rb->close( fh );
  43. -    return 0;
  44. +    return true;
  45.  }
  46.  
  47.  
  48. @@ -815,8 +820,7 @@
  49.                      LCD_RGBPACK(r, g, b);
  50.          }
  51.      }
  52. -    save_pfraw(target_path, &output_bmp);
  53. -    return true;
  54. +    return save_pfraw(target_path, &output_bmp);
  55.  }
  56.  
  57.  

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right worth-right