Create or Change multipage TIFFs - c++

I try to compose new and modify existing multipage TIFFs using Magick++.
Does someone know how I can do this?
I can read a specific page using this code:
Image * img = new Image("path/to/image.tif[0]"); //read page 0
But how can I save changes back to the TIFF? and how can I add new pages?
Google could only tell me things about splitting TIFFs in singe page ones.
Thanks for your help!

I never tried it but what about the writeImages function. Docs are here.
From the docs
Write images in container to file specified by string imageSpec_

Related

Read-in df from csv before launching main app | Dash

I am trying to get my first dashboard with python dash running.
The whole thing is very similar to this https://github.com/dkrizman/dash-manufacture-spc-dashboard.
At the beginning a Dataframe is read in from a csv. My problem seems to be quite easy to solve but somehow I am not succeeding:
I want to create a initial window that allows the user to select (from e.g. dropdown) the csv file (or accordingly the path) that is read in. All the .csv files look the same but just have different values.
When using the modal components I get problems with the install of bootstrap and I thought there must be an easier way?
Thanks for your help!
Best,
Nik

Grabbing Text from Sublime Text Regions

I'm new to creating Sublime Text 3 Plugins and I'm trying to understand the Plugin API that's offered. I want to be able to "grab" text I highlight with my mouse and move it somewhere else. Is there a way I can do this using the Sublime Text Plugin API?
So far, all I've done is be able to create a whole region:
allcontent = sublime.Region(0, self.view.size())
I've tried to grab all of the text in the region and put it into a lot file:
logfile = open("logfile.txt", "w")
logfile.write(allcontent)
But unsuccessfully of course as the log file is blank after it runs.
I've looked over google and there is not a lot of documentation, except for the unofficial documentation, in which I can't find a way to grab the text. Nor are there many tutorials on this.
Any help is greatly appreciated!
A Region just represents a region of text (i.e. from position 0 to position 10), and isn't tied to any specific view.
To get the underlying text from the view's buffer, you need to call the view.substr method with the region as a parameter.
import os
logpath = os.path.join(sublime.cache_path(), 'logfile.txt')
allcontent = self.view.substr(sublime.Region(0, self.view.size()))
with open(logpath, 'w') as logfile:
logfile.write(allcontent)
print('written buffer contents to', logpath)
To get the region represented by the first selection, you can use self.view.sel()[0] in place of sublime.Region(0, self.view.size()).

How do I create text file for Confluence and then import it as a Confluence wiki page?

Here is what I want to accomplish:
I am writing a script which will parse some source code, extract some comments that I want it to extract and I will store this text in a text file.
I want to write another script that uses the content of this text file to be programatically transformed into a Confluence wiki-page.
Please tell me the best way to do this. I already saw this
I felt that I could change the input in the above example to take input from text file and update contents of Confluence page. But, I am not sure how it will be formatted. If I have to format it, what do I need to do?
Thanks in advance!
As an alternative to XML-RPC you can use the integrated WebDAV plugin.
Write a script that creates a directory in the selected space.
The directory name will be the page name. After creating the directory a text-file with the same name (with .txt extension) will be created in the directory which holds the content of the page
let your script edit this file in insert the content of your text-file.
Information about the usage of the plugin:
Configuring a WebDAV client for Confluence
Confluence WebDAV Plugin
Troubleshooting WebDAV
I Also saw the code you are referring to. I tweaked it a bit a produced the following code that me help you for the second part of your question.
My code creates a new space and also a new page from a text file that is inserted in the previously created space.
import sys
import xmlrpc.client
import os
import re
# Connects to confluence server with username and password
site_URL = "YOUR_URL"
server = xmlrpc.client.ServerProxy(site_URL + "/rpc/xmlrpc")
username = "YOUR_USERNAME"
pwd = "YOUR_PASSWORD"
token = server.confluence2.login(username, pwd)
# The space you want to add a page to
spacekey = "YOUR_SPACENAME"
# Retrives text from a file
f = open('FileName.txt', 'r')
content = f.read()
f.close()
# Creates a new page to insert in the new space from text file content
newpage = {"title":"NEW_PAGENAME", "space":spacekey, "content":content}
server.confluence2.storePage(token, newpage)
server.confluence2.logout(token)
For your formatting issues, html is supported, but I have not quite figured out how to use CSS styles other than inline (everthing else does not seem to work).
These styles work when you write them with the HTML macro inside Confluence, but from the remote API, it does not seem to behave the same way.
UPDATE :
You can use the {html} macro to include your html by using :
content = server.confluence2.convertWikiToStorageFormat(token, content)
You can also specify your CSS in your global CSS stylesheet.
Another option is to develop a plugin to include a CSS resource :
https://developer.atlassian.com/display/CONFDEV/Creating+a+Stylesheet+Theme
I have tried this way and works petty well for me:
I used a Java program to created a programmatic client to create the dynamic content. This created a HTML document out of my plain text.
I used a RPC client connected to Confluence to uploaded it as a new page.
Your html will be preserved. But if you want to add CSS or JS/JQuery etc on top of your html you will need to create a Macro and enable it for the Particular page. This feature is not available in Confluence OnDemand.

In python ,How the method DocumentQuery() in gdata can use with image file such as .jpg .png?

In Google Doc APIs with Python >> gdata.docs.service.DocumentQuery(categories)
1.)How can it use with the image files? or Do I set categoiries parameter ,or not?
2.)The parameter(categories) ,how many type of the categories? I'm just know only folder and document.
Thank You :)

How to Check if a website contains Flash

I've created a web browser using mfc and i'm using IHhmlReader to read the contents of html when the user enters a url in the browser and page is completely loaded.Now i want to check if the webpage has any flash in it.
Any Helps would be highly appreciated.
Thank You.
I think this is a bit difficult to do, just reading from the HTML source, unless you try to instantiate the page and see if it's making a call to the Flash object. I have listed some options you can try, but you'll need to make sure that the code element is not commented out and check include files and iframes to see if Flash is called from there.
* Look for the OBJECT and EMBED tags (see http://kb2.adobe.com/cps/127/tn_12701.html)
* In page's JavaScript, look for SWFObject() call
* Look for the call to .swf file (could even be in an img tag)
Good luck...