Convert Base64 image from Landscape to Portrait - base64

In Mule4 I have image/png base64 data returned from an API call. When I decode the data I can see the image. However the image is coming out as landscape. Please can someone advise how I can convert this to portrait inside Mule? Is there something I need to change in the base64 data itself or can I perhaps write a java code snippet that could do this?
Thank You

You can use DataWeave fromBase64() function to decode the data and then use Java code to perform the transformation. Mule doesn't provide any image manipulation features, which makes sense.
I would recommend to encapsulate the transformation in a Mule module using the Mule SDK, for easy reuse.

Related

OFFIS DICOM scope toolkit Structured report link to image

Does anybody knows how to create a structured report using dicom scope toolkit via console (ubuntu 16.04) with a link to a related image?
The thing is that I have an image of some kind of trauma and I have to connect with a report which is in a text file. The last file should be in .dcm format which contains annotation and a link to an image. I have to use dicom scope program.
Maybe others refrain from answering because your question needs a very long answer. I cannot provide step-by-step instructions, a few hints, though.
The way I would go is to:
(assuming that your image is available in DICOM format):
obtain a sample structured report. I think that the "simple" Basic Text SR is what you want to go for. You can find some samples here.
convert the SR to an XML file using dsr2xml
edit the contents in XML. Do not forget to include your image reference in (0040,a730) Content Sequence -> (0008,1199) Referenced SOP Sequence
convert the XML back to DICOM SR using xml2dsr
By the way: From your question, I did not really understand why you want to use a structured report, as you wrote that your report is plain text. Instead of digging into the complex structure of SR, you may want to consider exporting the report to an Encapsulated PDF document which can reference images as well.

how to encode and decode pdf files using base64encode/decode ( windows app store )in c#

solution with sample using c#,
scenario:
Download encoded pdf file of base64Encode and decode(base64Decode) and store in ApplicationData.Current.LocalFolder;
you can use File.ReadAllBytes to load the PDF file into your program and then u can convert the loaded pdf file using Convert.ToBase64String(bytes) method
You might want to prefer this link
https://social.msdn.microsoft.com/forums/vstudio/en-US/e5965e02-0bbb-4f8d-9e5f-8611aa902457/how-to-convert-pdf-file-to-base64binary
Well, I am not going to write a solution with a complete sample for you, but I will point you to what may be the most exhaustive base42 discussion in Windows Runtime.
http://blog.jerrynixon.com/2014/11/reading-and-writing-base64-in-windows.html
It's a crazy coincidence that I just wrote this a few weeks ago. You'll notice that it is in the context of an image, but you should be able to translate it simple enough.
Remember to post your solution here!
Best of luck!

Java converter from kml/shapefile to Geojson

I would like to write a command line program using Java that take in KML/Shapfile and output GeoJSON file.
What I usually did is go over ogre2ogre and manually convert my file.
Once I got the GeoJson I modified the content of it a little bit before output final GeoJSON.
I would like to skip the manual part and find some API that do the conversion for me.
Anyone could help please.
Thanks
OSMBonusPack provides a KML+GeoJSON toolkit, with both a KML parser/writer and a GeoJSON parser/writer, all in Java.
So this allows to read KML content, and write it as GeoJSON.
You can test this conversion using the demo app OSMNavigator.
It is targeting Android, so for your need you would have to pick the relevant classes, and remove code sections you don't need (icon loading, overlay building, Parcelable implementation, for instance).

Fusesource - how to encode/decode base64 within a route

Trying to encode/decode base64 within an XML document that is handled within a route in Fusesource ESB.
We are using Blueprint.xml to try to encode/decode, but cannot find a way to do this.
We need our ruote to convert XML data to base64 string to hit an external webservice that requires some binary. We also need to extract some binary coming back from the webservice response and change this into .pdf (or a string first).
Fuse ESB / Apache Camel offers a number of data formats for encoding/decoding
http://camel.apache.org/data-format.html
Though we don't have a Base64 out of the box. So I have logged a ticket to add such a format in a future release: https://issues.apache.org/jira/browse/CAMEL-5807
You can build a custom data format, or use the message translator EIP pattern with a Java bean and do a bit of java code to do the encoding/decoding yourself. http://camel.apache.org/message-translator.html
There is a camel-fop component for outputting to PDF: http://camel.apache.org/fop.html

How to save an EXIF format image file in .NET 3.5

I want to save an image in EXIF format using System.Drawing.Image.Save or a similar method in a C# application using .NET framework v3.5. The MSDN documentation lists EXIF as an option for ImageFormat. However, it does not seem to be supported - at least not without some configuration unknown to me. When I enumerate the built-in encoders via ImageCodecInfo.GetImageEncoders() EXIF is not included. (Built in encoders on my machine (Vista Ultimate x64) are: BMP, JPEG, GIF, TIFF, and PNG.) If I save an image using the ImageFormat.Exif property, I simply get the default PNG format.
How can I save an image in EXIF format using .NET 3.5?
EXIF isn't a image file format per se, but a format for meta-data found within JPEG images conforming to the DSC (Digital Still Camera) standard as specified by JEITA.
GDI+ (i.e. Microsoft .NET Framework) allows you to read/write metadata image properties via the Image.PropertyItems, however the EXIF properties exposed by GDI+ are pretty cumbersome and don't convert the values the way you would expect. A lot of work is actually needed to be able to natively read/write these values (e.g. you'd need to unpack binary fields containing specially encoded values according to the JEITA spec).
A straight-forward open-source library which implements all the standard EXIF properties can be found at http://code.google.com/p/exif-utils/ This is probably the easiest way to do this. See the simple included demo which reads in a file, prints out all the EXIF properties and then adds a property to the image.
Have you seen this: Lossless JPEG Rewrites in C#

Resources