question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transformation erroneously replacing all overlay spaces to underscore

See original GitHub issue

Currently, Transformation class is replacing all spaces on parameters to underscore in this line: https://github.com/cloudinary/cloudinary_java/blob/738b328a9057084097b7e381bf8a6e989cf69b43/cloudinary-core/src/main/java/com/cloudinary/Transformation.java#L723

This is causing some issues, like when I try to use some font name that contains spaces (eg: Roboto Condensed), it replaces with underscores and the URL become invalid (because font is invalid). The same applies to text content (overlay), when using the text My Text Content it appears on final Image as My_Text_Content.

Example:

cloudinary.url()
		.signed(true)
		.resourceType("video")
		.transformation(new Transformation()
				.height(480)
				.width(720)
				.crop("fill")
				.chain()
				.color("white")
				.overlay("text:Roboto_70_bold:My Text Content"))
		.format("jpg")
		.generate("video/2130");

Results in:

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aditimadan-Cloudinarycommented, Feb 9, 2019

Hi Eduard,

That was a workaround. We also have a TextLayer class - that already handles all the encoding for you: https://github.com/cloudinary/cloudinary_java/blob/master/cloudinary-core/src/main/java/com/cloudinary/transformation/TextLayer.java

Example:

TextLayer t=layer.text("Roboto Condensed_70_bold:My Text Content");
		String url=cloudinary.url()
		.signed(true)
		.resourceType("video")
		.transformation(new Transformation()
				.height(480)
				.width(720)
				.crop("fill")
				.chain()
				.color("white")
				.overlay(t))
		.format("jpg")
		.generate("video/2130");

Thanks, Aditi

1reaction
aditimadan-Cloudinarycommented, Feb 9, 2019

Hi Eduard,

Can you please try using %20 instead of space and test

Eg:

cloudinary.url()
		.signed(true)
		.resourceType("video")
		.transformation(new Transformation()
				.height(480)
				.width(720)
				.crop("fill")
				.chain()
				.color("white")
				.overlay("text:Roboto%20Condensed_70_bold:My%20Text%20Content"))
		.format("jpg")
		.generate("video/2130");

Thanks, Aditi

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spaces replaced with underscores in transform - Forums
I am using IDA 7.5.3. When transforming a logical data model to a DB2 physical data model, any spaces in the logical object...
Read more >
Replace Low Values with Spaces using SORT
Let's take a look at the solution to the below-mentioned issues. How to replace all LOW-VALUES (X'00') in a file with SPACE (X'40')....
Read more >
Replace any data points with spaces with underscores ...
Suppose I have a data frame with some columns containing text and that in some cases there are spaces. In those ...
Read more >
Download - Sublime Text
All changes to a document are now represented by dedicated markers in the gutter ... Full inline diffs of each change can be...
Read more >
just checking in on you gif
You can change the speed of your GIF (speed up, slow down) and resize your GIFs to fit any social media platform. Hover...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found