IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[Imagick] Convertir pdf en jpg (ou png ou gif)


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 69
    Points : 45
    Points
    45
    Par défaut [Imagick] Convertir pdf en jpg (ou png ou gif)
    Bonjour, je viens de finir l'installation d'imagemagick et de Ghostscript.

    Lorsque que je fais un
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    convert capFM.jpg capFM.gif
    l'image gif est bien créé.
    Les commandes
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
     convert capFM.jpg -resize 300x300 cap1.jpg
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    convert capFM.jpg -resize 300x300 cap1.gif
    fonctionnent


    Mais lorsque je fais ou ou ou
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    convert capFM.jpg capFM.png
    ou
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    convert capFM.jpg -resize 300x300 cap1.png
    j'ai l'erreur suivante :



    Merci par avance pour votre aide

  2. #2
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    est ce que pdf est dans la liste obtenue avec identify -list format ?
    Autrement, en faite, je connais quasiement pas imagemagick, et je n'ai jamais été confronté a des soucis.
    L'aide que je t'ai apporté, c'est en cherchant via google !
    Peux-tu me donner l'intitulé exact de l'erreur ?

    Autrement, essais en utilisant la commande -verbose :
    ex : convert -verbose 1.pdf 1.jpg

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 69
    Points : 45
    Points
    45
    Par défaut
    Voici le identify -list format

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
     Format  Module    Mode  Description
    -------------------------------------------------------------------------------
            A* RAW       rw+   Raw alpha samples
           AI  PDF       rw-   Adobe Illustrator CS2
          ART* ART       rw-   PFS: 1st Publisher Clip Art
          ARW  DNG       r--   Sony Alpha Raw Image Format
          AVI* AVI       r--   Microsoft Audio/Visual Interleaved
          AVS* AVS       rw+   AVS X image
            B* RAW       rw+   Raw blue samples
          BMP* BMP       rw-   Microsoft Windows bitmap image
         BMP2* BMP       -w-   Microsoft Windows bitmap image v2
         BMP3* BMP       -w-   Microsoft Windows bitmap image v3
          BRF* BRAILLE   -w-   BRF ASCII Braille format
            C* RAW       rw+   Raw cyan samples
      CAPTION* CAPTION   r--   Image caption
          CIN* CIN       rw+   Cineon Image File
          CIP* CIP       -w-   Cisco IP phone image format
         CLIP* CLIP      -w+   Image Clip Mask
         CMYK* CMYK      rw+   Raw cyan, magenta, yellow, and black samples
        CMYKA* CMYK      rw+   Raw cyan, magenta, yellow, black, and alpha samples
          CR2  DNG       r--   Canon Digital Camera Raw Image Format
          CRW  DNG       r--   Canon Digital Camera Raw Image Format
          CUR* CUR       rw-   Microsoft icon
          CUT* CUT       r--   DR Halo
          DCM* DCM       r--   Digital Imaging and Communications in Medicine image
               DICOM is used by the medical community for images like X-rays.  The
               specification, "Digital Imaging and Communications in Medicine
               (DICOM)", is available at http://medical.nema.org/.  In particular,
               see part 5 which describes the image encoding (RLE, JPEG, JPEG-LS),
               and supplement 61 which adds JPEG-2000 encoding.
          DCR  DNG       r--   Kodak Digital Camera Raw Image File
          DCX* PCX       rw+   ZSoft IBM PC multi-page Paintbrush
          DDS* DDS       r--   Microsoft DirectDraw Surface
        DFONT* TTF       r--   Multi-face font package (Freetype 2.3.9)
         DJVU* DJVU      r--   Déjà vu
               See http://www.djvuzone.org/ for details about the DJVU format.  The
               DJVU 1.2 specification is available there and at
               ftp://swrinde.nde.swri.edu/pub/djvu/documents/.
          DNG  DNG       r--   Digital Negative
          DOT  DOT       r--   Graphviz
          DPS  DPS       ---   Display Postscript Interpreter
          DPX* DPX       rw+   SMPTE 268M-2003 (DPX 2.0)
               Digital Moving Picture Exchange Bitmap, Version 2.0.
               See SMPTE 268M-2003 specification at http://www.smtpe.org
     
         EPDF  PDF       rw-   Encapsulated Portable Document Format
          EPI  PS        rw-   Encapsulated PostScript Interchange format
          EPS  PS        rw-   Encapsulated PostScript
         EPS2* PS2       -w-   Level II Encapsulated PostScript
         EPS3* PS3       -w+   Level III Encapsulated PostScript
         EPSF  PS        rw-   Encapsulated PostScript
         EPSI  PS        rw-   Encapsulated PostScript Interchange format
          EPT  EPT       rw-   Encapsulated PostScript with TIFF preview
         EPT2  EPT       rw-   Encapsulated PostScript Level II with TIFF preview
         EPT3  EPT       rw+   Encapsulated PostScript Level III with TIFF preview
          ERF  DNG       r--   Epson RAW Format
          EXR* EXR       rw+   High Dynamic-range (HDR)
          FAX* FAX       rw+   Group 3 FAX
               FAX machines use non-square pixels which are 1.5 times wider than they
               are tall but computer displays use square pixels, therefore FAX images
               may appear to be narrow unless they are explicitly resized using a
               geometry of "150x100%".
     
         FITS* FITS      rw-   Flexible Image Transport System
      FRACTAL* PLASMA    r--   Plasma fractal image
          FTS* FTS       rw-   Flexible Image Transport System
            G* RAW       rw+   Raw green samples
           G3* FAX       rw-   Group 3 FAX
          GIF* GIF       rw+   CompuServe graphics interchange format
        GIF87* GIF       rw-   CompuServe graphics interchange format (version 87a)
     GRADIENT* GRADIENT  r--   Gradual linear passing from one shade to another
         GRAY* GRAY      rw+   Raw gray samples
    HISTOGRAM* HISTOGRAM -w-   Histogram of the image
          HTM* HTML      -w-   Hypertext Markup Language and a client-side image map
         HTML* HTML      -w-   Hypertext Markup Language and a client-side image map
          ICB* TGA       rw+   Truevision Targa image
          ICO* ICON      rw+   Microsoft icon
         ICON* ICON      rw-   Microsoft icon
         INFO  INFO      -w+   The image format and characteristics
       INLINE* INLINE    r--   Base64-encoded inline images
          IPL* IPL       rw+   IPL Image Sequence
       ISOBRL* BRAILLE   -w-   ISO/TR 11548-1 format
          JNG* PNG       rw-   JPEG Network Graphics
               See http://www.libpng.org/pub/mng/ for details about the JNG
               format.
          JP2* JP2       rw-   JPEG-2000 File Format Syntax
          JPC* JPC       rw-   JPEG-2000 Code Stream Syntax
         JPEG* JPEG      rw-   Joint Photographic Experts Group JFIF format (62)
          JPG* JPEG      rw-   Joint Photographic Experts Group JFIF format
          JPX* JPX       rw-   JPEG-2000 File Format Syntax
            K* RAW       rw+   Raw black samples
          K25  DNG       r--   Kodak Digital Camera Raw Image Format
          KDC  DNG       r--   Kodak Digital Camera Raw Image Format
        LABEL* LABEL     r--   Image label
            M* RAW       rw+   Raw magenta samples
          M2V  MPEG      rw+   MPEG Video Stream
          M4V  MPEG      rw+   Raw MPEG-4 Video
          MAP* MAP       rw-   Colormap intensities and indices
          MAT  MAT       rw+   MATLAB image format
        MATTE* MATTE     -w+   MATTE format
         MIFF* MIFF      rw+   Magick Image File Format
          MNG* PNG       rw+   Multiple-image Network Graphics (libpng 1.2.27)
               See http://www.libpng.org/pub/mng/ for details about the MNG
               format.
         MONO* MONO      rw-   Raw bi-level bitmap
          MOV  MPEG      rw+   MPEG Video Stream
          MP4  MPEG      rw+   MPEG-4 Video Stream
          MPC* MPC       rw+   Magick Persistent Cache image format
         MPEG  MPEG      rw+   MPEG Video Stream
          MPG  MPEG      rw+   MPEG Video Stream
          MRW  DNG       r--   Sony (Minolta) Raw Image File
          MSL* MSL       rw+   Magick Scripting Language
         MSVG  SVG       rw+   ImageMagick's own SVG internal renderer
          MTV* MTV       rw+   MTV Raytracing image format
          MVG* MVG       rw-   Magick Vector Graphics
          NEF  DNG       r--   Nikon Digital SLR Camera Raw Image File
         NULL* NULL      rw-   Constant image of uniform color
            O* RAW       rw+   Raw opacity samples
          ORF  DNG       r--   Olympus Digital Camera Raw Image File
          OTB* OTB       rw-   On-the-air bitmap
          OTF* TTF       r--   Open Type font (Freetype 2.3.9)
          PAL* UYVY      rw-   16bit/pixel interleaved YUV
         PALM* PALM      rw+   Palm pixmap
          PAM* PNM       rw+   Common 2-dimensional bitmap format
      PATTERN* PATTERN   r--   Predefined pattern
          PBM* PNM       rw+   Portable bitmap format (black and white)
          PCD* PCD       rw-   Photo CD
         PCDS* PCD       rw-   Photo CD
          PCL  PCL       rw-   Printer Control Language
          PCT* PICT      rw-   Apple Macintosh QuickDraw/PICT
          PCX* PCX       rw-   ZSoft IBM PC Paintbrush
          PDB* PDB       rw+   Palm Database ImageViewer Format
          PDF  PDF       rw+   Portable Document Format
         PDFA  PDF       rw+   Portable Document Archive Format
          PEF  DNG       r--   Pentax Electronic File
          PFA* TTF       r--   Postscript Type 1 font (ASCII) (Freetype 2.3.9)
          PFB* TTF       r--   Postscript Type 1 font (binary) (Freetype 2.3.9)
          PFM* PFM       rw+   Portable float format
          PGM* PNM       rw+   Portable graymap format (gray scale)
          PGX* PGX       r--   JPEG-2000 VM Format
        PICON* XPM       rw-   Personal Icon
         PICT* PICT      rw-   Apple Macintosh QuickDraw/PICT
          PIX* PIX       r--   Alias/Wavefront RLE image format
        PJPEG* JPEG      rw-   Progessive Joint Photographic Experts Group JFIF
       PLASMA* PLASMA    r--   Plasma fractal image
          PNG* PNG       rw-   Portable Network Graphics (libpng 1.2.27)
               See http://www.libpng.org/ for details about the PNG format.
        PNG24* PNG       rw-   opaque 24-bit RGB (zlib 1.2.3.3)
        PNG32* PNG       rw-   opaque or transparent 32-bit RGBA
         PNG8* PNG       rw-   8-bit indexed with optional binary transparency
          PNM* PNM       rw+   Portable anymap
          PPM* PNM       rw+   Portable pixmap format (color)
      PREVIEW* PREVIEW   -w-   Show a preview an image enhancement, effect, or f/x
           PS  PS        rw+   PostScript
          PS2* PS2       -w+   Level II PostScript
          PS3* PS3       -w+   Level III PostScript
          PSD* PSD       rw+   Adobe Photoshop bitmap
         PTIF* TIFF      rw+   Pyramid encoded TIFF
          PWP* PWP       r--   Seattle Film Works
            R* RAW       rw+   Raw red samples
    RADIAL-GRADIENT* GRADIENT  r--   Gradual radial passing from one shade to another
          RAF  DNG       r--   Fuji CCD-RAW Graphic File
          RAS* SUN       rw+   SUN Rasterfile
          RGB* RGB       rw+   Raw red, green, and blue samples
         RGBA* RGB       rw+   Raw red, green, blue, and alpha samples
         RGBO* RGB       rw+   Raw red, green, blue, and opacity samples
          RLA* RLA       r--   Alias/Wavefront image
          RLE* RLE       r--   Utah Run length encoded image
          SCR* SCR       r--   ZX-Spectrum SCREEN$
          SCT* SCT       r--   Scitex HandShake
          SFW* SFW       r--   Seattle Film Works
          SGI* SGI       rw+   Irix RGB image
        SHTML* HTML      -w-   Hypertext Markup Language and a client-side image map
          SR2  DNG       r--   Sony Raw Format 2
          SRF  DNG       r--   Sony Raw Format
      STEGANO* STEGANO   r--   Steganographic image
          SUN* SUN       rw+   SUN Rasterfile
          SVG  SVG       rw+   Scalable Vector Graphics (XML 2.6.32)
         SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (XML 2.6.32)
         TEXT* TXT       rw-   Text
          TGA* TGA       rw+   Truevision Targa image
    THUMBNAIL* THUMBNAIL -w+   EXIF Profile Thumbnail
         TIFF* TIFF      rw+   Tagged Image File Format (LIBTIFF, Version 3.8.2)
       TIFF64* TIFF      ---   Tagged Image File Format (64-bit) (LIBTIFF, Version 3.8.2)
         TILE* TILE      r--   Tile image with a texture
          TIM* TIM       r--   PSX TIM
          TTC* TTF       r--   TrueType font collection (Freetype 2.3.9)
          TTF* TTF       r--   TrueType font (Freetype 2.3.9)
          TXT* TXT       rw-   Text
         UBRL* BRAILLE   -w-   Unicode Text format
          UIL* UIL       -w-   X-Motif UIL table
         UYVY* UYVY      rw-   16bit/pixel interleaved YUV
          VDA* TGA       rw+   Truevision Targa image
        VICAR* VICAR     rw-   VICAR rasterfile format
          VID* VID       rw+   Visual Image Directory
         VIFF* VIFF      rw+   Khoros Visualization image
          VST* TGA       rw+   Truevision Targa image
         WBMP* WBMP      rw-   Wireless Bitmap (level 0) image
          WMF* WMF       r--   Windows Meta File
          WMV  MPEG      rw+   Windows Media Video
          WMZ* WMZ       r--   Compressed Windows Meta File
          WPG* WPG       r--   Word Perfect Graphics
            X* X         rw+   X Image
          X3F  DNG       r--   Sigma Camera RAW Picture File
          XBM* XBM       rw-   X Windows system bitmap (black and white)
           XC* XC        r--   Constant image uniform color
          XCF* XCF       r--   GIMP image
          XPM* XPM       rw-   X Windows system pixmap (color)
          XPS  XPS       r--   Microsoft XML Paper Specification
           XV* VIFF      rw+   Khoros Visualization image
          XWD* XWD       rw-   X Windows system window dump (color)
            Y* RAW       rw+   Raw yellow samples
        YCbCr* YCbCr     rw+   Raw Y, Cb, and Cr samples
       YCbCrA* YCbCr     rw+   Raw Y, Cb, Cr, and alpha samples
          YUV* YUV       rw-   CCIR 601 4:1:1 or 4:2:2
     
    * native blob support
    r read support
    w write support
    + support for multiple images

    L'erreur exact est 'erreur de segmentation', en anglais je crois que c'est segmentation fault. J'ai posté mon soucis sur forum d'imagemagick. En cas de solution, je l'a posterai ici.

    Sinon voici le resultat d'un convert -verbose 1.pdf 1.jpg

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    "gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pam" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dUseCIEColor  "-sOutputFile=/tmp/magick-XXMG4zVB" "-f/tmp/magick-XXTjerB9" "-f/tmp/magick-XXEERphH"
     
     
     
     
    Erreur de segmentation

  4. #4
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    ca te le fait avec tous les pdf ?
    Peux tu joindre un pdf avec erreur ?

  5. #5
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    et que donne :
    gs -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72x72 -dUseCIEColor -sOutputFile=bla.jpeg 1.pdf

    (c'est la commande lancé par convert, qui appelle en faite ghostscript pour faire le boulot, cf le convert -verbose 1.pdf 1.jpg)

    Z.

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 69
    Points : 45
    Points
    45
    Par défaut
    Cela fonctionne, cependant, cela fait une image assez lourde 3Mo et la qualité d'affichage est médiocre.

  7. #7
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    et avec
    gs -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 -sDEVICE=pam -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -r72x72 -dUseCIEColor -sOutputFile=bla.jpeg 1.pdf

    J'ai changer le type jpeg par le type pam que represente vraiment ta commande

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 69
    Points : 45
    Points
    45
    Par défaut
    :S le fichier jpg fait 123Mo et n'est pas visionnable....

  9. #9
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    mais sa fonctionne...

    Est ce que ca le fait avec tous els pdf ?

  10. #10
    Membre du Club
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    69
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 69
    Points : 45
    Points
    45
    Par défaut
    Avec un autre PDF, le fichier bla.jpg fait 88Mo et n'est pas visionnable... Le pdf en fait 5Mo

  11. #11
    Membre éclairé
    Profil pro
    Assistant recherche bioinformatique
    Inscrit en
    Novembre 2007
    Messages
    877
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations professionnelles :
    Activité : Assistant recherche bioinformatique

    Informations forums :
    Inscription : Novembre 2007
    Messages : 877
    Points : 835
    Points
    835
    Par défaut
    le convert, est ce qu'il te fait une erreur avec d'autres pdf qui auraient été généré d'une autre façon ?

Discussions similaires

  1. Convertir pdf en jpg
    Par l.mnu dans le forum Développement Windows
    Réponses: 1
    Dernier message: 18/05/2013, 10h22
  2. convertir .doc, .xlsx, jpg, png en pdf
    Par tortuegenie dans le forum ASP.NET
    Réponses: 6
    Dernier message: 04/05/2012, 11h37
  3. Convertir des documents en ( pdf et jpg )
    Par Loubna.B dans le forum C#
    Réponses: 7
    Dernier message: 28/09/2009, 16h46
  4. Convertir Eps en Jpg ou PNG
    Par aaakii dans le forum Applications et environnements graphiques
    Réponses: 4
    Dernier message: 11/09/2007, 12h47
  5. conversion pdf en (jpg, png, etc)
    Par djibril dans le forum Modules
    Réponses: 1
    Dernier message: 11/07/2006, 18h31

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo