跳转到内容

如何自动程序更新基于元数据的资产

常时你发现自己翻转数据库、营销发布媒体资产 并同时努力记住 当事物改变更新

云化过程容易得多免手动创建产品图像新版时,当标价、可用性、日期、数量或任何其他变化时,你可直接参考资产元数据对飞转变换文本覆盖并自动修改





参考资产结构化元数据字段中通过标准变换URL变换API或通过云家SDKhelper函数使用用户定义变量.

想要引用资产结构元数据转换并添加文本层下图解解析

开工创建几个结构化元数据字段您可以通过UI或UI创建、更新和删除这些元数据API.

三个结构元领域: 物价描述和股号

二叉通过UI或API添加元值细节

3级现在你准备搭建URL即时变换优先声明用户定义变量以便您可以在变换后引用基本结构定义元值变量${variable_name}_md:!{metadata_field}!.后,您可将这些变量分解文本层中资产中

逐段解析最终 URL

  • https://res.www.aaaalireno.com/testy1/image/upload/
    带云交付域资产类型图像和交付类型上载量
  • $descriptionvar_md:!description/$stock_md:!stock!/$price_md:!price!
    引用元数据字段'描述'并添加用户定义变量后用名`desc'参考,并用变量参考数外元数据字段
  • l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray
    即使用前定义变量'desc'添加文本层并使用变量文本内容并置重力变换;裁剪层脱机定义它宽度,后台颜色字体颜色.添加层物价变量
  • shoes_vq5e2g.png
    最后,具体说明公共标识中控全元数据

费力工作后 剩余URL

<\/Image>","codeSnippet":" \n\t \n\t \n\t \n\t \n\t \n\t \n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":" <\/cld-image>","codeSnippet":" \n\t \n\t \n\t \n\t \n\t \n\t \n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":" <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-image>","codeSnippet":" \n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('shoes_vq5e2g.png', {transformation: [ {variables: [[\"$desc\", \"md:!description!\"]]}, {variables: [[\"$stock\", \"md:!stock!\"]]}, {variables: [[\"$price\", \"md:!price!\"]]}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, color: \"white\", background: \"gray\", crop: \"fit\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('shoes_vq5e2g.png', {transformation: [\n {variables: [[\"$desc\", \"md:!description!\"]]},\n {variables: [[\"$stock\", \"md:!stock!\"]]},\n {variables: [[\"$price\", \"md:!price!\"]]},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, color: \"white\", background: \"gray\", crop: \"fit\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"shoes_vq5e2g.png\").image(transformation=[ {'variables': [[\"$desc\", \"md:!description!\"]]}, {'variables': [[\"$stock\", \"md:!stock!\"]]}, {'variables': [[\"$price\", \"md:!price!\"]]}, {'overlay': {'font_family': \"verdana\", 'font_size': 15, 'text': \"%24%28desc%29\"}, 'gravity': \"north_west\", 'width': 160, 'color': \"white\", 'background': \"gray\", 'crop': \"fit\"}, {'overlay': {'font_family': \"verdana\", 'font_size': 60, 'text': \"%24%28price%29\"}, 'gravity': \"north_east\", 'color': \"red\"}, {'overlay': {'font_family': \"verdana\", 'font_size': 10, 'text': \"Only%20%24%28stock%29%20left%20in%20stock\"}, 'gravity': \"south_east\"} ])","codeSnippet":"CloudinaryImage(\"shoes_vq5e2g.png\").image(transformation=[\n {'variables': [[\"$desc\", \"md:!description!\"]]},\n {'variables': [[\"$stock\", \"md:!stock!\"]]},\n {'variables': [[\"$price\", \"md:!price!\"]]},\n {'overlay': {'font_family': \"verdana\", 'font_size': 15, 'text': \"%24%28desc%29\"}, 'gravity': \"north_west\", 'width': 160, 'color': \"white\", 'background': \"gray\", 'crop': \"fit\"},\n {'overlay': {'font_family': \"verdana\", 'font_size': 60, 'text': \"%24%28price%29\"}, 'gravity': \"north_east\", 'color': \"red\"},\n {'overlay': {'font_family': \"verdana\", 'font_size': 10, 'text': \"Only%20%24%28stock%29%20left%20in%20stock\"}, 'gravity': \"south_east\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('shoes_vq5e2g.png'))\n\t->addVariable(Variable::setFromMetadata(\"desc\",\"description\"))\n\t->addVariable(Variable::setFromMetadata(\"stock\",\"stock\"))\n\t->addVariable(Variable::setFromMetadata(\"price\",\"price\"))\n\t->overlay(Overlay::source(\n\tSource::text(\"$(desc)\",(new TextStyle(\"verdana\",15)))\n\t->textFit(\n\tTextFit::size(160))\n\t->textColor(Color::WHITE)\n\t->backgroundColor(Color::GRAY)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northWest()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(price)\",(new TextStyle(\"verdana\",60)))\n\t->textColor(Color::RED)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northEast()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"Only $(stock) left in stock\",(new TextStyle(\"verdana\",10))))\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::southEast()))\n\t)\n\t);","codeSnippet":"(new ImageTag('shoes_vq5e2g.png'))\n\t->addVariable(Variable::setFromMetadata(\"desc\",\"description\"))\n\t->addVariable(Variable::setFromMetadata(\"stock\",\"stock\"))\n\t->addVariable(Variable::setFromMetadata(\"price\",\"price\"))\n\t->overlay(Overlay::source(\n\tSource::text(\"$(desc)\",(new TextStyle(\"verdana\",15)))\n\t->textFit(\n\tTextFit::size(160))\n\t->textColor(Color::WHITE)\n\t->backgroundColor(Color::GRAY)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northWest()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(price)\",(new TextStyle(\"verdana\",60)))\n\t->textColor(Color::RED)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northEast()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"Only $(stock) left in stock\",(new TextStyle(\"verdana\",10))))\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::southEast()))\n\t)\n\t);","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", array(\"transformation\"=>array( array(\"variables\"=>array(array(\"$desc\", \"md:!description!\"))), array(\"variables\"=>array(array(\"$stock\", \"md:!stock!\"))), array(\"variables\"=>array(array(\"$price\", \"md:!price!\"))), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>15, \"text\"=>\"%24%28desc%29\"), \"gravity\"=>\"north_west\", \"width\"=>160, \"color\"=>\"white\", \"background\"=>\"gray\", \"crop\"=>\"fit\"), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>60, \"text\"=>\"%24%28price%29\"), \"gravity\"=>\"north_east\", \"color\"=>\"red\"), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>10, \"text\"=>\"Only%20%24%28stock%29%20left%20in%20stock\"), \"gravity\"=>\"south_east\") )))","codeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", array(\"transformation\"=>array(\n array(\"variables\"=>array(array(\"$desc\", \"md:!description!\"))),\n array(\"variables\"=>array(array(\"$stock\", \"md:!stock!\"))),\n array(\"variables\"=>array(array(\"$price\", \"md:!price!\"))),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>15, \"text\"=>\"%24%28desc%29\"), \"gravity\"=>\"north_west\", \"width\"=>160, \"color\"=>\"white\", \"background\"=>\"gray\", \"crop\"=>\"fit\"),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>60, \"text\"=>\"%24%28price%29\"), \"gravity\"=>\"north_east\", \"color\"=>\"red\"),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>10, \"text\"=>\"Only%20%24%28stock%29%20left%20in%20stock\"), \"gravity\"=>\"south_east\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().variables(variable(\"$desc\",\"md:!description!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).color(\"white\").background(\"gray\").crop(\"fit\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\")).imageTag(\"shoes_vq5e2g.png\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .variables(variable(\"$desc\",\"md:!description!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).color(\"white\").background(\"gray\").crop(\"fit\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\")).imageTag(\"shoes_vq5e2g.png\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", :transformation=>[ {:variables=>[[\"$desc\", \"md:!description!\"]]}, {:variables=>[[\"$stock\", \"md:!stock!\"]]}, {:variables=>[[\"$price\", \"md:!price!\"]]}, {:overlay=>{:font_family=>\"verdana\", :font_size=>15, :text=>\"%24%28desc%29\"}, :gravity=>\"north_west\", :width=>160, :color=>\"white\", :background=>\"gray\", :crop=>\"fit\"}, {:overlay=>{:font_family=>\"verdana\", :font_size=>60, :text=>\"%24%28price%29\"}, :gravity=>\"north_east\", :color=>\"red\"}, {:overlay=>{:font_family=>\"verdana\", :font_size=>10, :text=>\"Only%20%24%28stock%29%20left%20in%20stock\"}, :gravity=>\"south_east\"} ])","codeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", :transformation=>[\n {:variables=>[[\"$desc\", \"md:!description!\"]]},\n {:variables=>[[\"$stock\", \"md:!stock!\"]]},\n {:variables=>[[\"$price\", \"md:!price!\"]]},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>15, :text=>\"%24%28desc%29\"}, :gravity=>\"north_west\", :width=>160, :color=>\"white\", :background=>\"gray\", :crop=>\"fit\"},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>60, :text=>\"%24%28price%29\"}, :gravity=>\"north_east\", :color=>\"red\"},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>10, :text=>\"Only%20%24%28stock%29%20left%20in%20stock\"}, :gravity=>\"south_east\"}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Variables(\"$desc\", md:!description!).Chain() .Variables(\"$stock\", md:!stock!).Chain() .Variables(\"$price\", md:!price!).Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(15).Text(\"%24%28desc%29\")).Gravity(\"north_west\").Width(160).Color(\"white\").Background(\"gray\").Crop(\"fit\").Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(60).Text(\"%24%28price%29\")).Gravity(\"north_east\").Color(\"red\").Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(10).Text(\"Only%20%24%28stock%29%20left%20in%20stock\")).Gravity(\"south_east\")).BuildImageTag(\"shoes_vq5e2g.png\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .Variables(\"$desc\", md:!description!).Chain()\n .Variables(\"$stock\", md:!stock!).Chain()\n .Variables(\"$price\", md:!price!).Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(15).Text(\"%24%28desc%29\")).Gravity(\"north_west\").Width(160).Color(\"white\").Background(\"gray\").Crop(\"fit\").Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(60).Text(\"%24%28price%29\")).Gravity(\"north_east\").Color(\"red\").Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(10).Text(\"Only%20%24%28stock%29%20left%20in%20stock\")).Gravity(\"south_east\")).BuildImageTag(\"shoes_vq5e2g.png\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"));","codeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().chain() .chain() .chain() .setOverlay(\"text:verdana_15:%24%28desc%29\").setGravity(\"north_west\").setWidth(160).setColor(\"white\").setBackground(\"gray\").setCrop(\"fit\").chain() .setOverlay(\"text:verdana_60:%24%28price%29\").setGravity(\"north_east\").setColor(\"red\").chain() .setOverlay(\"text:verdana_10:Only%20%24%28stock%29%20left%20in%20stock\").setGravity(\"south_east\")).generate(\"shoes_vq5e2g.png\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()\n .chain()\n .chain()\n .chain()\n .setOverlay(\"text:verdana_15:%24%28desc%29\").setGravity(\"north_west\").setWidth(160).setColor(\"white\").setBackground(\"gray\").setCrop(\"fit\").chain()\n .setOverlay(\"text:verdana_60:%24%28price%29\").setGravity(\"north_east\").setColor(\"red\").chain()\n .setOverlay(\"text:verdana_10:Only%20%24%28stock%29%20left%20in%20stock\").setGravity(\"south_east\")).generate(\"shoes_vq5e2g.png\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().variables(variable(\"$desc\",\"md:!description!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).color(\"white\").background(\"gray\").crop(\"fit\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\")).generate(\"shoes_vq5e2g.png\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .variables(variable(\"$desc\",\"md:!description!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).color(\"white\").background(\"gray\").crop(\"fit\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\")).generate(\"shoes_vq5e2g.png\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"));","codeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"shoes_vq5e2g.png\")\n\t addVariable(Variable.setFromMetadata(\"desc\",\"description\"))\n\t addVariable(Variable.setFromMetadata(\"stock\",\"stock\"))\n\t addVariable(Variable.setFromMetadata(\"price\",\"price\"))\n\t overlay(Overlay.source(\n\tSource.text(\"\\$(desc)\",TextStyle(\"verdana\",15)) {\n\t textFit(\n\tTextFit.size(160))\n\t textColor(Color.WHITE)\n\t backgroundColor(Color.GRAY)\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.northWest()))\n\t })\n\t })\n\t overlay(Overlay.source(\n\tSource.text(\"\\$(price)\",TextStyle(\"verdana\",60)) {\n\t textColor(Color.RED)\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.northEast()))\n\t })\n\t })\n\t overlay(Overlay.source(\n\tSource.text(\"Only \\$(stock) left in stock\",TextStyle(\"verdana\",10))) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.southEast()))\n\t })\n\t }) \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"shoes_vq5e2g.png\")\n\t addVariable(Variable.setFromMetadata(\"desc\",\"description\"))\n\t addVariable(Variable.setFromMetadata(\"stock\",\"stock\"))\n\t addVariable(Variable.setFromMetadata(\"price\",\"price\"))\n\t overlay(Overlay.source(\n\tSource.text(\"\\$(desc)\",TextStyle(\"verdana\",15)) {\n\t textFit(\n\tTextFit.size(160))\n\t textColor(Color.WHITE)\n\t backgroundColor(Color.GRAY)\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.northWest()))\n\t })\n\t })\n\t overlay(Overlay.source(\n\tSource.text(\"\\$(price)\",TextStyle(\"verdana\",60)) {\n\t textColor(Color.RED)\n\t }) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.northEast()))\n\t })\n\t })\n\t overlay(Overlay.source(\n\tSource.text(\"Only \\$(stock) left in stock\",TextStyle(\"verdana\",10))) {\n\t position(Position() {\n\t gravity(\n\tGravity.compass(\n\tCompass.southEast()))\n\t })\n\t }) \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"shoes_vq5e2g.png\", {transformation: [ {variables: [[\"$desc\", \"md:!description!\"]]}, {variables: [[\"$stock\", \"md:!stock!\"]]}, {variables: [[\"$price\", \"md:!price!\"]]}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, color: \"white\", background: \"gray\", crop: \"fit\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"} ]})","codeSnippet":"$.cloudinary.image(\"shoes_vq5e2g.png\", {transformation: [\n {variables: [[\"$desc\", \"md:!description!\"]]},\n {variables: [[\"$stock\", \"md:!stock!\"]]},\n {variables: [[\"$price\", \"md:!price!\"]]},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, color: \"white\", background: \"gray\", crop: \"fit\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"Only%20%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east\"\n);","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.aaaalireno.com\/testy1\/image\/upload\/$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only%20$(stock)%20left%20in%20stock,g_south_east\/shoes_vq5e2g.png","cloud_name":"testy1","host":"res.www.aaaalireno.com","type":"upload","resource_type":"image","transformation":[{"$desc":"md:!description!"},{"$stock":"md:!stock!"},{"$price":"md:!price!"},{"overlay":"text:verdana_15:$(desc)","gravity":"north_west","crop_mode":"fit","width":"160","color":"white","background":"gray"},{"overlay":"text:verdana_60:$(price)","gravity":"north_east","color":"red"},{"overlay":"text:verdana_10:Only $(stock) left in stock","gravity":"south_east"}],"transformation_string":"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,co_white,b_gray\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:Only $(stock) left in stock,g_south_east","url_suffix":"","version":"","secure":true,"public_id":"shoes_vq5e2g.png","extension":"png","format":"png","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" > 加载代码示例

使用结构化元数据的最大作用是资产可自动更新而无需修改交付URL也可以创建if报表程序修改资产基于元数据字段

举例说,如果库存下降低于一定量,你只需加一if语句对URL自动修改图像可使用云端元数据API程序化连接外部数据库和资产元数据包含产品数据(例如标价、盘点等),进一步实现进程自动化

       if_$stock_lt_1/l_text:verdana_100:SOLD%20码OUT,co_red/if_end代码语言PHP高山市php)
<\/Image>","codeSnippet":" \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n<\/Image>","status":0,"statusText":"Ok","displayName":"React","packageName":"cloudinary-react","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue_2","framework":"vue_2","language":"vue","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"@cloudinary\/vue","packageStatus":"","packageVersion":"1.x"},{"sdkId":"vue","framework":"vue","language":"vue","rawCodeSnippet":" <\/cld-image>","codeSnippet":" \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n\t \n<\/cld-image>","status":0,"statusText":"Ok","displayName":"Vue.js","packageName":"cloudinary-vue","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"angular_2","framework":"angular_2","language":"angular","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/ng","packageStatus":"","packageVersion":"1.x"},{"sdkId":"angular","framework":"angular","language":"angular","rawCodeSnippet":" <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-transformation> <\/cl-image>","codeSnippet":" \n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n\t \n\t<\/cl-transformation>\n<\/cl-image>","status":0,"statusText":"Ok","displayName":"Angular","packageName":"@cloudinary\/angular-5.x","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"js_2","framework":"js_2","language":"js","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","status":0,"statusText":"Ok","displayName":"JS","packageName":"@cloudinary\/url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"js","framework":"js","language":"js","rawCodeSnippet":"cloudinary.imageTag('shoes_vq5e2g.png', {transformation: [ {variables: [[\"$desc\", \"md:!description!\"]]}, {variables: [[\"$stock\", \"md:!stock!\"]]}, {variables: [[\"$price\", \"md:!price!\"]]}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, background: \"lightblue\", crop: \"fit\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"}, {if: \"$stock_lt_1\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\"), color: \"red\"}, {if: \"end\"} ]}).toHtml();","codeSnippet":"cloudinary.imageTag('shoes_vq5e2g.png', {transformation: [\n {variables: [[\"$desc\", \"md:!description!\"]]},\n {variables: [[\"$stock\", \"md:!stock!\"]]},\n {variables: [[\"$price\", \"md:!price!\"]]},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, background: \"lightblue\", crop: \"fit\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"},\n {if: \"$stock_lt_1\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\"), color: \"red\"},\n {if: \"end\"}\n ]}).toHtml();","status":0,"statusText":"Ok","displayName":"JS","packageName":"cloudinary-core","packageStatus":"legacy","packageVersion":"2.x"},{"sdkId":"python","framework":"python","language":"python","rawCodeSnippet":"CloudinaryImage(\"shoes_vq5e2g.png\").image(transformation=[ {'variables': [[\"$desc\", \"md:!description!\"]]}, {'variables': [[\"$stock\", \"md:!stock!\"]]}, {'variables': [[\"$price\", \"md:!price!\"]]}, {'overlay': {'font_family': \"verdana\", 'font_size': 15, 'text': \"%24%28desc%29\"}, 'gravity': \"north_west\", 'width': 160, 'background': \"lightblue\", 'crop': \"fit\"}, {'overlay': {'font_family': \"verdana\", 'font_size': 60, 'text': \"%24%28price%29\"}, 'gravity': \"north_east\", 'color': \"red\"}, {'overlay': {'font_family': \"verdana\", 'font_size': 10, 'text': \"%24%28stock%29%20left%20in%20stock\"}, 'gravity': \"south_east\"}, {'if': \"$stock_lt_1\"}, {'overlay': {'font_family': \"verdana\", 'font_size': 100, 'text': \"SOLD%20OUT\"}, 'color': \"red\"}, {'if': \"end\"} ])","codeSnippet":"CloudinaryImage(\"shoes_vq5e2g.png\").image(transformation=[\n {'variables': [[\"$desc\", \"md:!description!\"]]},\n {'variables': [[\"$stock\", \"md:!stock!\"]]},\n {'variables': [[\"$price\", \"md:!price!\"]]},\n {'overlay': {'font_family': \"verdana\", 'font_size': 15, 'text': \"%24%28desc%29\"}, 'gravity': \"north_west\", 'width': 160, 'background': \"lightblue\", 'crop': \"fit\"},\n {'overlay': {'font_family': \"verdana\", 'font_size': 60, 'text': \"%24%28price%29\"}, 'gravity': \"north_east\", 'color': \"red\"},\n {'overlay': {'font_family': \"verdana\", 'font_size': 10, 'text': \"%24%28stock%29%20left%20in%20stock\"}, 'gravity': \"south_east\"},\n {'if': \"$stock_lt_1\"},\n {'overlay': {'font_family': \"verdana\", 'font_size': 100, 'text': \"SOLD%20OUT\"}, 'color': \"red\"},\n {'if': \"end\"}\n ])","status":0,"statusText":"Ok","displayName":"Python","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"php_2","framework":"php_2","language":"php","rawCodeSnippet":"(new ImageTag('shoes_vq5e2g.png'))\n\t->addVariable(Variable::setFromMetadata(\"desc\",\"description\"))\n\t->addVariable(Variable::setFromMetadata(\"stock\",\"stock\"))\n\t->addVariable(Variable::setFromMetadata(\"price\",\"price\"))\n\t->overlay(Overlay::source(\n\tSource::text(\"$(desc)\",(new TextStyle(\"verdana\",15)))\n\t->textFit(\n\tTextFit::size(160))\n\t->backgroundColor(Color::LIGHTBLUE)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northWest()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(price)\",(new TextStyle(\"verdana\",60)))\n\t->textColor(Color::RED)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northEast()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(stock) left in stock\",(new TextStyle(\"verdana\",10))))\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::southEast()))\n\t)\n\t)\n\t->conditional(Conditional::ifCondition(\"$stock < 1\",(new Transformation())\n\t->overlay(Overlay::source(\n\tSource::text(\"SOLD OUT\",(new TextStyle(\"verdana\",100)))\n\t->textColor(Color::RED)\n\t))));","codeSnippet":"(new ImageTag('shoes_vq5e2g.png'))\n\t->addVariable(Variable::setFromMetadata(\"desc\",\"description\"))\n\t->addVariable(Variable::setFromMetadata(\"stock\",\"stock\"))\n\t->addVariable(Variable::setFromMetadata(\"price\",\"price\"))\n\t->overlay(Overlay::source(\n\tSource::text(\"$(desc)\",(new TextStyle(\"verdana\",15)))\n\t->textFit(\n\tTextFit::size(160))\n\t->backgroundColor(Color::LIGHTBLUE)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northWest()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(price)\",(new TextStyle(\"verdana\",60)))\n\t->textColor(Color::RED)\n\t)\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::northEast()))\n\t)\n\t)\n\t->overlay(Overlay::source(\n\tSource::text(\"$(stock) left in stock\",(new TextStyle(\"verdana\",10))))\n\t->position((new Position())\n\t->gravity(\n\tGravity::compass(\n\tCompass::southEast()))\n\t)\n\t)\n\t->conditional(Conditional::ifCondition(\"$stock < 1\",(new Transformation())\n\t->overlay(Overlay::source(\n\tSource::text(\"SOLD OUT\",(new TextStyle(\"verdana\",100)))\n\t->textColor(Color::RED)\n\t))));","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"","packageVersion":"2.x"},{"sdkId":"php","framework":"php","language":"php","rawCodeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", array(\"transformation\"=>array( array(\"variables\"=>array(array(\"$desc\", \"md:!description!\"))), array(\"variables\"=>array(array(\"$stock\", \"md:!stock!\"))), array(\"variables\"=>array(array(\"$price\", \"md:!price!\"))), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>15, \"text\"=>\"%24%28desc%29\"), \"gravity\"=>\"north_west\", \"width\"=>160, \"background\"=>\"lightblue\", \"crop\"=>\"fit\"), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>60, \"text\"=>\"%24%28price%29\"), \"gravity\"=>\"north_east\", \"color\"=>\"red\"), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>10, \"text\"=>\"%24%28stock%29%20left%20in%20stock\"), \"gravity\"=>\"south_east\"), array(\"if\"=>\"$stock_lt_1\"), array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>100, \"text\"=>\"SOLD%20OUT\"), \"color\"=>\"red\"), array(\"if\"=>\"end\") )))","codeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", array(\"transformation\"=>array(\n array(\"variables\"=>array(array(\"$desc\", \"md:!description!\"))),\n array(\"variables\"=>array(array(\"$stock\", \"md:!stock!\"))),\n array(\"variables\"=>array(array(\"$price\", \"md:!price!\"))),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>15, \"text\"=>\"%24%28desc%29\"), \"gravity\"=>\"north_west\", \"width\"=>160, \"background\"=>\"lightblue\", \"crop\"=>\"fit\"),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>60, \"text\"=>\"%24%28price%29\"), \"gravity\"=>\"north_east\", \"color\"=>\"red\"),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>10, \"text\"=>\"%24%28stock%29%20left%20in%20stock\"), \"gravity\"=>\"south_east\"),\n array(\"if\"=>\"$stock_lt_1\"),\n array(\"overlay\"=>array(\"font_family\"=>\"verdana\", \"font_size\"=>100, \"text\"=>\"SOLD%20OUT\"), \"color\"=>\"red\"),\n array(\"if\"=>\"end\")\n )))","status":0,"statusText":"Ok","displayName":"PHP","packageName":"cloudinary_php","packageStatus":"legacy","packageVersion":"1.x"},{"sdkId":"java","framework":"java","language":"java","rawCodeSnippet":"cloudinary.url().transformation(new Transformation().variables(variable(\"$desc\",\"md:!description!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).background(\"lightblue\").crop(\"fit\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\").chain() .if(\"$stock_lt_1\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\")).color(\"red\").chain() .if(\"end\")).imageTag(\"shoes_vq5e2g.png\");","codeSnippet":"cloudinary.url().transformation(new Transformation()\n .variables(variable(\"$desc\",\"md:!description!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).background(\"lightblue\").crop(\"fit\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\").chain()\n .if(\"$stock_lt_1\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\")).color(\"red\").chain()\n .if(\"end\")).imageTag(\"shoes_vq5e2g.png\");","status":0,"statusText":"Ok","displayName":"Java","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"ruby","framework":"ruby","language":"ruby","rawCodeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", :transformation=>[ {:variables=>[[\"$desc\", \"md:!description!\"]]}, {:variables=>[[\"$stock\", \"md:!stock!\"]]}, {:variables=>[[\"$price\", \"md:!price!\"]]}, {:overlay=>{:font_family=>\"verdana\", :font_size=>15, :text=>\"%24%28desc%29\"}, :gravity=>\"north_west\", :width=>160, :background=>\"lightblue\", :crop=>\"fit\"}, {:overlay=>{:font_family=>\"verdana\", :font_size=>60, :text=>\"%24%28price%29\"}, :gravity=>\"north_east\", :color=>\"red\"}, {:overlay=>{:font_family=>\"verdana\", :font_size=>10, :text=>\"%24%28stock%29%20left%20in%20stock\"}, :gravity=>\"south_east\"}, {:if=>\"$stock_lt_1\"}, {:overlay=>{:font_family=>\"verdana\", :font_size=>100, :text=>\"SOLD%20OUT\"}, :color=>\"red\"}, {:if=>\"end\"} ])","codeSnippet":"cl_image_tag(\"shoes_vq5e2g.png\", :transformation=>[\n {:variables=>[[\"$desc\", \"md:!description!\"]]},\n {:variables=>[[\"$stock\", \"md:!stock!\"]]},\n {:variables=>[[\"$price\", \"md:!price!\"]]},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>15, :text=>\"%24%28desc%29\"}, :gravity=>\"north_west\", :width=>160, :background=>\"lightblue\", :crop=>\"fit\"},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>60, :text=>\"%24%28price%29\"}, :gravity=>\"north_east\", :color=>\"red\"},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>10, :text=>\"%24%28stock%29%20left%20in%20stock\"}, :gravity=>\"south_east\"},\n {:if=>\"$stock_lt_1\"},\n {:overlay=>{:font_family=>\"verdana\", :font_size=>100, :text=>\"SOLD%20OUT\"}, :color=>\"red\"},\n {:if=>\"end\"}\n ])","status":0,"statusText":"Ok","displayName":"Ruby","packageName":"cloudinary","packageStatus":"","packageVersion":"1.x"},{"sdkId":"csharp","framework":"csharp","language":"csharp","rawCodeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation().Variables(\"$desc\", md:!description!).Chain() .Variables(\"$stock\", md:!stock!).Chain() .Variables(\"$price\", md:!price!).Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(15).Text(\"%24%28desc%29\")).Gravity(\"north_west\").Width(160).Background(\"lightblue\").Crop(\"fit\").Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(60).Text(\"%24%28price%29\")).Gravity(\"north_east\").Color(\"red\").Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(10).Text(\"%24%28stock%29%20left%20in%20stock\")).Gravity(\"south_east\").Chain() .If(\"$stock_lt_1\").Chain() .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(100).Text(\"SOLD%20OUT\")).Color(\"red\").Chain() .If(\"end\")).BuildImageTag(\"shoes_vq5e2g.png\")","codeSnippet":"cloudinary.Api.UrlImgUp.Transform(new Transformation()\n .Variables(\"$desc\", md:!description!).Chain()\n .Variables(\"$stock\", md:!stock!).Chain()\n .Variables(\"$price\", md:!price!).Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(15).Text(\"%24%28desc%29\")).Gravity(\"north_west\").Width(160).Background(\"lightblue\").Crop(\"fit\").Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(60).Text(\"%24%28price%29\")).Gravity(\"north_east\").Color(\"red\").Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(10).Text(\"%24%28stock%29%20left%20in%20stock\")).Gravity(\"south_east\").Chain()\n .If(\"$stock_lt_1\").Chain()\n .Overlay(new TextLayer().FontFamily(\"verdana\").FontSize(100).Text(\"SOLD%20OUT\")).Color(\"red\").Chain()\n .If(\"end\")).BuildImageTag(\"shoes_vq5e2g.png\")","status":0,"statusText":"Ok","displayName":".NET","packageName":"CloudinaryDotNet","packageStatus":"","packageVersion":"1.x"},{"sdkId":"dart","framework":"dart","language":"dart","rawCodeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"));","codeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"));","status":0,"statusText":"Ok","displayName":"Dart","packageName":"cloudinary_dart","packageStatus":"","packageVersion":"0.x"},{"sdkId":"swift","framework":"swift","language":"swift","rawCodeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation().chain() .chain() .chain() .setOverlay(\"text:verdana_15:%24%28desc%29\").setGravity(\"north_west\").setWidth(160).setBackground(\"lightblue\").setCrop(\"fit\").chain() .setOverlay(\"text:verdana_60:%24%28price%29\").setGravity(\"north_east\").setColor(\"red\").chain() .setOverlay(\"text:verdana_10:%24%28stock%29%20left%20in%20stock\").setGravity(\"south_east\").chain() .setIf(\"$stock_lt_1\").chain() .setOverlay(\"text:verdana_100:SOLD%20OUT\").setColor(\"red\").chain() .setIf(\"end\")).generate(\"shoes_vq5e2g.png\")!, cloudinary: cloudinary)","codeSnippet":"imageView.cldSetImage(cloudinary.createUrl().setTransformation(CLDTransformation()\n .chain()\n .chain()\n .chain()\n .setOverlay(\"text:verdana_15:%24%28desc%29\").setGravity(\"north_west\").setWidth(160).setBackground(\"lightblue\").setCrop(\"fit\").chain()\n .setOverlay(\"text:verdana_60:%24%28price%29\").setGravity(\"north_east\").setColor(\"red\").chain()\n .setOverlay(\"text:verdana_10:%24%28stock%29%20left%20in%20stock\").setGravity(\"south_east\").chain()\n .setIf(\"$stock_lt_1\").chain()\n .setOverlay(\"text:verdana_100:SOLD%20OUT\").setColor(\"red\").chain()\n .setIf(\"end\")).generate(\"shoes_vq5e2g.png\")!, cloudinary: cloudinary)","status":0,"statusText":"Ok","displayName":"iOS","packageName":"cloudinary","packageStatus":"","packageVersion":"3.x"},{"sdkId":"android","framework":"android","language":"android","rawCodeSnippet":"MediaManager.get().url().transformation(new Transformation().variables(variable(\"$desc\",\"md:!description!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain() .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).background(\"lightblue\").crop(\"fit\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\").chain() .if(\"$stock_lt_1\").chain() .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\")).color(\"red\").chain() .if(\"end\")).generate(\"shoes_vq5e2g.png\");","codeSnippet":"MediaManager.get().url().transformation(new Transformation()\n .variables(variable(\"$desc\",\"md:!description!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).chain()\n .variables(variable(\"$desc\",\"md:!description!\")).variables(variable(\"$stock\",\"md:!stock!\")).variables(variable(\"$price\",\"md:!price!\")).chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\")).gravity(\"north_west\").width(160).background(\"lightblue\").crop(\"fit\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\")).gravity(\"north_east\").color(\"red\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\")).gravity(\"south_east\").chain()\n .if(\"$stock_lt_1\").chain()\n .overlay(new TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\")).color(\"red\").chain()\n .if(\"end\")).generate(\"shoes_vq5e2g.png\");","status":0,"statusText":"Ok","displayName":"Android","packageName":"cloudinary-android","packageStatus":"","packageVersion":"1.x"},{"sdkId":"flutter","framework":"flutter","language":"flutter","rawCodeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"));","codeSnippet":"cloudinary.image('shoes_vq5e2g.png').transformation(Transformation()\n\t.addTransformation(\"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"));","status":0,"statusText":"Ok","displayName":"Flutter","packageName":"cloudinary_flutter","packageStatus":"","packageVersion":"0.x"},{"sdkId":"kotlin","framework":"kotlin","language":"kotlin","rawCodeSnippet":"cloudinary.image {\n\tpublicId(\"shoes_vq5e2g.png\")\n\t addTransformation(\"\\$desc_md:!description!\/\\$stock_md:!stock!\/\\$price_md:!price!\/l_text:verdana_15:\\$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:\\$(price),g_north_east,co_red\/l_text:verdana_10:\\$(stock) left in stock,g_south_east\/if_\\$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\") \n}.generate()","codeSnippet":"cloudinary.image {\n\tpublicId(\"shoes_vq5e2g.png\")\n\t addTransformation(\"\\$desc_md:!description!\/\\$stock_md:!stock!\/\\$price_md:!price!\/l_text:verdana_15:\\$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:\\$(price),g_north_east,co_red\/l_text:verdana_10:\\$(stock) left in stock,g_south_east\/if_\\$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\") \n}.generate()","status":0,"statusText":"Ok","displayName":"Kotlin","packageName":"kotlin-url-gen","packageStatus":"","packageVersion":"1.x"},{"sdkId":"jquery","framework":"jquery","language":"jquery","rawCodeSnippet":"$.cloudinary.image(\"shoes_vq5e2g.png\", {transformation: [ {variables: [[\"$desc\", \"md:!description!\"]]}, {variables: [[\"$stock\", \"md:!stock!\"]]}, {variables: [[\"$price\", \"md:!price!\"]]}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, background: \"lightblue\", crop: \"fit\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"}, {if: \"$stock_lt_1\"}, {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\"), color: \"red\"}, {if: \"end\"} ]})","codeSnippet":"$.cloudinary.image(\"shoes_vq5e2g.png\", {transformation: [\n {variables: [[\"$desc\", \"md:!description!\"]]},\n {variables: [[\"$stock\", \"md:!stock!\"]]},\n {variables: [[\"$price\", \"md:!price!\"]]},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(15).text(\"%24%28desc%29\"), gravity: \"north_west\", width: 160, background: \"lightblue\", crop: \"fit\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(60).text(\"%24%28price%29\"), gravity: \"north_east\", color: \"red\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(10).text(\"%24%28stock%29%20left%20in%20stock\"), gravity: \"south_east\"},\n {if: \"$stock_lt_1\"},\n {overlay: new cloudinary.TextLayer().fontFamily(\"verdana\").fontSize(100).text(\"SOLD%20OUT\"), color: \"red\"},\n {if: \"end\"}\n ]})","status":0,"statusText":"Ok","displayName":"jQuery","packageName":"cloudinary-jquery","packageStatus":"","packageVersion":"2.x"},{"sdkId":"react_native","framework":"react_native","language":"react_native","rawCodeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","codeSnippet":"new CloudinaryImage(\"shoes_vq5e2g.png\").addTransformation(\n \"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end\"\n);","status":0,"statusText":"Ok","displayName":"React Native","packageName":"cloudinary-react-native","packageStatus":"","packageVersion":"0.x"}]" parsed-url="{"url":"https:\/\/res.www.aaaalireno.com\/testy1\/image\/upload\/$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock)%20left%20in%20stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD%20OUT,co_red\/if_end\/shoes_vq5e2g.png","cloud_name":"testy1","host":"res.www.aaaalireno.com","type":"upload","resource_type":"image","transformation":[{"$desc":"md:!description!"},{"$stock":"md:!stock!"},{"$price":"md:!price!"},{"overlay":"text:verdana_15:$(desc)","gravity":"north_west","crop_mode":"fit","width":"160","background":"lightblue"},{"overlay":"text:verdana_60:$(price)","gravity":"north_east","color":"red"},{"overlay":"text:verdana_10:$(stock) left in stock","gravity":"south_east"},{"if":"$stock_lt_1"},{"overlay":"text:verdana_100:SOLD OUT","color":"red"},{"if":"end"}],"transformation_string":"$desc_md:!description!\/$stock_md:!stock!\/$price_md:!price!\/l_text:verdana_15:$(desc),g_north_west,c_fit,w_160,b_lightblue\/l_text:verdana_60:$(price),g_north_east,co_red\/l_text:verdana_10:$(stock) left in stock,g_south_east\/if_$stock_lt_1\/l_text:verdana_100:SOLD OUT,co_red\/if_end","url_suffix":"","version":"","secure":true,"public_id":"shoes_vq5e2g.png","extension":"png","format":"png","format_code":true,"signature":"","private_cdn":false,"result_asset_type":"image"}" with-url="true" > 加载代码示例
注释 :

更新现有资产时需要提交失效请求,以便更新旧缓存版

结构化元数据字段变换一开始可能看起来复杂化,但通过小实践,你可创建惊人程序资产

现在,你学会了如何引用资产结构元域变换,你可以通过合并资产条件变换或简单缩短URL快速自动更新资产连用都行命名变换大规模实现新变换无穷无尽

回顶

特征邮箱

Baidu
map