• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

CFimage resize

Contributor ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

Bonjour,

Quand je veux redimensionner une image (.jpg), j'ai le message suivant :

The  ServerFile image format is not supported on this operating system

mais quand je n'utilise pas cette fonction, le serveur accepte !

<cfimage action="resize" source="File.ServerFile" height="300" width="200" name="resized">

Merci d'avance pour votre aide

Views

2.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

Which version of Coldfusion are you using and what hotfix version is it?

Can you give the full code you are using that gives you the error as well.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

Bonjour,

According to the docs for CFIMAGE, you can use a variable to contain the image to be resized.  As haxtbhā€‹ has pointed out, we really cannot understand what is wrong without seeing your code.  But if the image is being uploaded from a form, you need to use CFFILE to save it in a variable, then use CFIMAGE to resize the image.

Selon les documents pour CFIMAGE, vous pouvez utiliser une variable pour contenir l'image Ơ redimensionner. Comme haxtbh l'a soulignƩ, nous ne pouvons vraiment pas comprendre ce qui ne va pas sans voir votre code. Mais si l'image est tƩlƩchargƩe Ơ partir d'un formulaire, vous devez utiliser CFFILE pour l'enregistrer dans une variable, puis utiliser CFIMAGE pour redimensionner l'image.

HTH,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

Avant tout merci pour vos rƩponses !

Voici mon code :

1ĆØre partie avec un cfform :

<INPUT type="file" name="PhotoFile" size="55" accept="image/jpg, image/jpeg, image/gif">

2ĆØme partie :

<CFFILE

    Action="UPLOAD"

    Filefield="PhotoFile"

    Destination="#StrPath##session.site##sep#_cartes#sep#"

    Nameconflict="Overwrite"

    Accept="image/gif, image/jpg, image/jpeg"

   >

   <cfimage action="resize" source="File.ServerFile" height="300" width="200" name="resized">

Rien d'extraordinaire !

Cordialement

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 13, 2017 Mar 13, 2017

Copy link to clipboard

Copied

Your CFFILE is saving the uploaded image to a destination.  Use CFFILE to read the file you saved as a binary, give it a name, and use that for the CFIMAGE resize.

OR, if you don't need the original file, you can skip saving it to a destination and save it in memory and use the memory to resize the file and save that to a destination.

Votre CFFILE enregistre l'image tƩlƩchargƩe dans une destination. Utilisez CFFILE pour lire le fichier que vous avez enregistrƩ en tant que binaire, donnez-lui un nom et utilisez-le pour le redimensionnement CFIMAGE.

OU, si vous n'avez pas besoin du fichier d'origine, vous pouvez sauter l'enregistrement vers une destination et l'enregistrer en mƩmoire et utiliser la mƩmoire pour redimensionner le fichier et l'enregistrer dans une destination.

HTH,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 14, 2017 Mar 14, 2017

Copy link to clipboard

Copied

DƩsolƩ !

Puis-je avoir un exemple car je ne comprends pas votre explication ?

Merci par avance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 14, 2017 Mar 14, 2017

Copy link to clipboard

Copied

Since you are using the "destination" attribute in your CFFILE upload, the uploaded file is saved to the hard drive.  At this point, you cannot use "cffile.serverfile" to access the file because it is no longer in CF memory - it is on the server hard drive.

At this point, one option is to (after the first CFFILE) use another CFFILE to "read" the file into a CF variable and use the variable content to resize the image.  This will allow you to keep the original file size saved to the hard drive while saving a second, resized image to the hard drive.  So, after your first CFFILE:

Puisque vous utilisez l'attribut "destination" dans votre tĆ©lĆ©chargement CFFILE, le fichier tĆ©lĆ©chargĆ© est enregistrĆ© sur le disque dur. ƀ ce stade, vous ne pouvez pas utiliser "cffile.serverfile" pour accĆ©der au fichier car il n'est plus dans la mĆ©moire CF - il se trouve sur le disque dur du serveur.

ƀ ce stade, une option est de (aprĆØs le premier CFFILE) utiliser un autre CFFILE pour "lire" le fichier dans une variable CF et utiliser le contenu de la variable pour redimensionner l'image. Cela vous permettra de conserver la taille du fichier d'origine sauvegardĆ©e sur le disque dur tout en sauvegardant une seconde image redimensionnĆ©e sur le disque dur. Ainsi, aprĆØs votre premier CFFILE:

<!--- Ceci va lire le fichier juste enregistrĆ© et le stocker dans une  variable CF nommĆ©e 'varName', le redimensionner, puis l'enregistrer sur  le disque dur--->

<cffile action="readBinary" file=""#StrPath##session.site##sep#_cartes#sep#filename" variable="varName" />

<cfimage action="resize" source="#varName#" height="300" width="200" name="resized">

<cffile action="write" file="full path name and file name" output="#resized#" addnewline="no" fixnewline="no" />

HTH,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 15, 2017 Mar 15, 2017

Copy link to clipboard

Copied

Bonjour,

Est-il obligatoire de garder l'image originale ?

Merci par avance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2017 Mar 15, 2017

Copy link to clipboard

Copied

Bonjour,

C'est tout Ơ fait votre dƩcision. Si vous avez besoin de conserver le fichier d'origine, le code que j'ai fourni conserverait Ơ la fois l'original et les images redimensionnƩes. Si vous n'avez pas besoin de l'original, vous pouvez utiliser CFFILE action = "delete" pour supprimer l'original.

Avec respect,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 15, 2017 Mar 15, 2017

Copy link to clipboard

Copied

MalgrĆ© toutes vos instructions, cela bloque šŸ˜ž

Voici mon code :

<CFOUTPUT>
   <CFIF right(StrPath,1) IS "/">
    <cfset sep="/">
   <CFELSE>
    <cfset sep="\">
   </CFIF>

   <CFFILE
    Action="UPLOAD"
    Filefield="PhotoFile"
    Destination="#StrPath##session.site##sep#_cartes#sep#"
    Nameconflict="Overwrite"
    Accept="image/gif, image/jpg, image/jpeg"
   />
   <CFIF File.Filesize GT taillemax>
      
    <!--- Lire le fichier enregistrĆ© et le stocker dans une  variable CF nommĆ©e 'varName', le redimensionner, puis l'enregistrer sur  le disque dur---> 
   
    <CFFILE
     action="readBinary"
     file="#StrPath##session.site##sep#_cartes#sep##serverFileName#.#serverFileExt#"
     variable="varName"
    /> 
    
    <cfimage action="resize" source="#varName#" height="300" width="200" name="resized">
   
    <CFFILE 
     action="write"
     file="#StrPath##session.site##sep#_cartes#sep##varName#"
     output="#resized#"
     addnewline="no"
     fixnewline="no"
    /> 
    <CFELSE>
    <cfset myfile2=#File.ServerFile#>
   </CFIF>

Encore merci !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 15, 2017 Mar 15, 2017

Copy link to clipboard

Copied

Une des premiĆØres choses que j'ai remarquĆ© est que vous utilisez "File.FileSize"; Il doit ĆŖtre "CFfile.FileSize" (le rĆ©sultat "File.x" a Ć©tĆ© dĆ©conseillĆ©, rĆ©cemment.)

En outre, vous vĆ©rifiez le dernier caractĆØre d'un chemin pour voir si le sĆ©parateur de dossier est "\" ou "/"; Le dernier caractĆØre du chemin peut ou non toujours ĆŖtre le caractĆØre sĆ©parateur. Obtenez le chemin d'accĆØs, puis utilisez "Find ('/', filePath)", Ć  la place. Si "/" existe, c'est le sĆ©parateur; Sinon, alors "\" est le sĆ©parateur.

Une autre suggestion serait de dĆ©finir des variables Ć  partir du premier CFFILE (c'est-Ć -dire, sf = CFFILE.ServerFileName, sfe = CFFILE.ServerFileExt, etc.) et utiliser celles du deuxiĆØme CFFILE (file = "# StrPath ## session.site ## sep # _cartes # sep ## sf #. # Sfe # ").

HTH,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

Bonjour,

MalgrĆ© tous ces changements, il y a toujours le serveur qui plante šŸ˜ž

Vous pouvez essayer :

SoLivres - Invitations

en choisissant l'image personnelle (et bien entendu trĆØs grosse)

Merci par avance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

Bonjour,

Je ne peux pas accĆ©der au lien que vous avez fourni. Mes administrateurs de travail bloquent l'accĆØs Ć  votre site, Ć  partir d'ici.

Quels messages d'erreur, le cas ƩchƩant, sont-ils prƩsentƩs? Des messages d'erreur des FC, des messages d'erreur JavaScript ou du navigateur. Est-ce que les journaux de CFAdmin vous disent quelque chose?

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

Bonjour,

Le fait que vous ne pouvez pas vous connecter Ơ mon site de dƩveloppement me contrarie beaucoup. Pourriez-vous vous renseigner pourquoi vos administrateurs bloquent le site que je puisse faire remonter l'information car je suis sur un serveur partagƩ.

Je suis pour un long moment pas chez moi. Aussi je teste mes programmes directement en ligne.

J'ai pour message, un "504 Gateway Time-out"

Merci par avance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

Le message d'erreur "504" signifie que le serveur Web attend votre serveur CF et qu'il ne reƧoit pas de rƩponse en temps opportun. Chargez-vous des images dont la taille est supƩrieure Ơ 1 mƩgaoctet?

En ce qui concerne la dĆ©cision des administrateurs rĆ©seau de bloquer votre site, je travaille pour le ministĆØre de la DĆ©fense (je suis un entrepreneur fĆ©dĆ©ral) et ils sont trĆØs paranoĆÆaques sur la sĆ©curitĆ© Internet et intranet. Il existe de nombreux sites Web qui sont bloquĆ©s pour diverses raisons, et ils ne changeront pas leur position sur cette question.

V/r,

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

Hi,

Your source code as a lot of interesting things going on.  Some of that may be causing the issues you are seeing.  Couple points of note for your code:

  • You can always use "/" as a file path separator regardless of operating system you are on.
  • The spaces inside your code make it difficult to read.  Spaces inside the pound signs are not necessary and may cause issues.
  • Unless you are outputing a var, or quoting it,  you don't need to put pound signs around it.  For example, the var set of myfile2.
  • The accept value had spaces in it that makes the value invalid. It should be "image/gif" not "image / gif".
  • When writing an image  you should cfimage action="write" after you resize the image.  Alternatively you can just add a destination to the resize action to save it automatically.

Take a look at this blog post.  It shows how to upload and resize an image.  It does save the image to a database but you can ignore that part.

http://www.dreamincode.net/forums/topic/254793-how-to-resize-and-add-an-image-to-a-database/

HTH,

--Dave

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 17, 2017 Mar 17, 2017

Copy link to clipboard

Copied

Bonjour,

La photo issu d'un iPhone fait 938 Ko !

Mais le problĆØme c'est que cela peut arriver souvent !

Je vais essayer avec

http://www.dreamincode.net/forums/topic/254793-how-to-resize-and-add-an-image-to-a-databas e

Mais je trouve cela compliquƩ. Suis ƩtonnƩ qu'Adobe n'est pas intƩgrƩ la fonction.

Merci par avance

NB : je comprends pour le blocage de sites

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 20, 2017 Mar 20, 2017

Copy link to clipboard

Copied

Bonjour,

J'ai essayƩ avec Dreamincode et cela plante toujours !

Je ne comprends plus rien. Dois ĆŖtre maudit šŸ˜ž

Voici mon code :

<span class="notranslate" onmouseover="_tipon(this)" onmouseout="_tipoff()">

<span class="google-src-text" style="text-align: left; direction: ltr;">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<CFINCLUDE template="inc_init_admin.cfm">

<CFINCLUDE template="inc_verif_var2.cfm">

<title>Essai cfimage</title>

<CFIF NOT IsDefined("mode")><cfset mode=""></CFIF>

<cfset StrPath=ExpandPath( "../../" ) />

<cfset taillemax=500000>

</head>

<body>

<!--------------------------------- INSERT ------------------------------------------>

<CFIF Mode IS "insert">

  <CFOUTPUT>

   <CFIF Find('/',StrPath) IS "/">

    <cfset sep="/">

   <CFELSE>

    <cfset sep="\">

   </CFIF>

  </CFOUTPUT>

  <cfif Picture neq "">

   <cftry>

    <cffile

     action="upload"

     filefield="Picture"

     Destination="#StrPath#zennetbuilder.com#sep#Solivres#sep#_cartes#sep#Images_upload"

     accept="image/jpeg, image/jpg, image/pjpeg"

     nameconflict="makeunique">

    <cfimage

     action = "info"

     source = "#StrPath#zennetbuilder.com#sep#Solivres#sep#_cartes#sep#images_upload#sep##serverfile#"

     structname = "Picturetest">

  

    <cfoutput>

     <cfset Picturewidth =  #Picturetest.width#>

     <cfset Pictureheight =  #Picturetest.height#>

     <cfset PictureSmallwidth = 200>

     <cfset PictureSmallHeight = #Pictureheight# / #Picturewidth# * #PictureSmallwidth#>

    </cfoutput>

    <cfimage action = "resize"

     height = "#Round(PictureSmallHeight)#"

     width="200"

     source="#StrPath#zennetbuilder.com#sep#Solivres#sep#_cartes#sep#Images_upload#sep##serverfile#"

     destination="#StrPath#zennetbuilder.com#sep##Solivres#sep#_cartes#sep#Images#sep##serverfile#"

    >

  

   </cftry>

  <cfelse>

   <CFQUERY name="Cartes" datasource="#session.dbname#">

    INSERT INTO cartes

    (PICTURE

    sitename)

    VALUES

    ('#SERVERFILE#'

    '#session.site#')

   </cfquery>

   <script language="Javascript">

    alert ("Votre fichier a Ć©tĆ© enregistrĆ©")

   </script>

   <cflocation url="cartes.cfm">

  </cfif>

</CFIF>

<!--------------------------------- Addpic ------------------------------------------>

<CFIF Mode IS "">

    <table border="0" cellpadding="0" cellspacing="1" width="500" align="center">

  <cfform action="picture_add.cfm" name="AddPic" method="post" enctype="multipart/form-data">

   <tr>

    <td align="right" class="Copy" valign="top">Photo:</td>

    <td align="left" class="Copy" valign="top">

     <cfinput type="file" name="PICTURE" required="no">

    </td>

   </tr>

   <tr>

    <td> </td>

    <td align="left">

     <cfinput type="submit" name="Submit" value="Submit">

    </td>

   </tr>

        </cfform>

    </table>

</CFIF>

</body>

</html>

</span> !

Merci par avance

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 25, 2017 Mar 25, 2017

Copy link to clipboard

Copied

Bonjour,

Help !!!

Je ne trouve toujours pas šŸ˜ž

Je ne vois pas le bug !

Je voudrais en faire une fonction. C'est Ć©tonnant qu'Adobe ne propose pas ce type de fonction en standard !

Existe-t-il des sites qui le propose ?

Merci par avance pour votre aide

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 25, 2017 Mar 25, 2017

Copy link to clipboard

Copied

Your original question:

<cfimage source="File.ServerFile">

The  ServerFile image format is not supported on this operating system

ColdFusion responded correctly. It was an error. See my last post how you can fix it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 26, 2017 Mar 26, 2017

Copy link to clipboard

Copied

Bonjour,

"The  ServerFile image format is not supported on this operating system"

C'est justement lĆ  mon problĆØme car je ne vois pas pourquoi le serveur refuse ce format alors :

  • pour d'autres scripts, je n'ai pas de soucis
  • accept="image/jpeg, image/jpg, image/pjpeg"

Merci pour votre aide

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 26, 2017 Mar 26, 2017

Copy link to clipboard

Copied

ZNB  wrote

<cfimage source="File.ServerFile">

"The  ServerFile image format is not supported on this operating system"

Car le fichier file.serverfile n'existe pas. Vous voulez dire: #file.serverfile#

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

LATEST

Merci pour votre aide !

J'ai enfin rƩussi.

Je ne devais pas ĆŖtre trĆØs rĆ©veillĆ© šŸ˜‰

Merci Ć  tous

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 16, 2017 Mar 16, 2017

Copy link to clipboard

Copied

ZNB  wrote

Bonjour,

Quand je veux redimensionner une image (.jpg), j'ai le message suivant :

The  ServerFile image format is not supported on this operating system

mais quand je n'utilise pas cette fonction, le serveur accepte !

<cfimage action="resize" source="File.ServerFile" height="300" width="200" name="resized">

Merci d'avance pour votre aide

<cffile

    action = "upload"

    destination = "{absolute_path_to_directory}"

    etc.

>

<!--- Plus tard --->

<cfimage action="resize" source="{absolute_path_to_directory}\#File.ServerFile#" height="300" width="200" name="resized">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation