[FFmpeg-devel] libavcodec : add psd image file decoder

Martin Vignali martin.vignali at gmail.com
Sun Jul 24 18:29:29 EEST 2016


2016-07-24 16:36 GMT+02:00 Moritz Barsnick <barsnick at gmx.net>:

> On Sun, Jul 24, 2016 at 15:21:00 +0200, Martin Vignali wrote:
> > Subject: [PATCH] libavcodec : add decoder for .psd image file.
> [...]
> > +- Psd Decoder
> [...]
> > + at item PSD          @tab   @tab X
> > +    @tab Photoshop
> [...]
> > +        .long_name = NULL_IF_CONFIG_SMALL("Photoshop file"),
>
> ".psd", "psd", "Psd", "Photoshop file". I think some consistency would
> be nice. E.g. use "Photoshop PSD file" as long name, "PSD" in the
> descriptions (and not the name of the extension with dot).
>
> But that's just cosmetics...
>
> > +    if ((s->channel_count < 1)||(s->channel_count > 56)) {
> [...]
> > +    if ((s->height < 1)||(s->height > 30000)) {
> [...]
> > +    if ((s->width < 1)||(s->width > 30000)) {
>
> You could leave whitespace around the operators, for readability.
>
> > +                avpriv_report_missing_feature(avctx, "channel depth
> unsupported for rgb %d", s->channel_depth);
>
> For the sake of "grammar", I would say:
>                 avpriv_report_missing_feature(avctx, "channel depth %d
> unsupported for rgb", s->channel_depth);
> (Same with channel_count and with grayscale below.)
>
> > +    /* reorganize uncompress data. each channel is store one after the
> other */
>                                       ^E                   ^stored
>
> > +    if ((b[4] == 0)&&(b[5] == 1)) {/* version 1 is PSD, version 2 is
> PSB */
> [...]
> > +    if ((AV_RL32(b+6) == 0)&&(AV_RL16(b+10) == 0))/* reserved must be 0
> */
> [...]
> > +        if ((color_mode <= 9)&&(color_mode != 5)&&(color_mode != 6))
> Whitespace, as mentioned above.
>
>
> Correct locally.


More information about the ffmpeg-devel mailing list