My model can save images and also doc files,
If user save the images then it should be save in three sizes like small/big...
If user save doc then It should be save as normal document
Anybody can help me....
You can write proc in the styles definition, so you at process time define styles. If there no styles the original file saved only, without processing. See more here at Dynamic Configuration section.
Related
I wart to create a web app where a user enters certain data via a form and then receives a custom rendered image. The image is from a smart object in a psd. It's kind of like a mock-up which definitely requires needs some photoshop filters to be properly rendered.
This should all happen in real time and should be doable from my understanding since the rendering of a single images doesn't need much computing power
I've done some research and haven't really found a solution the matches my problem. Is it necessary to run Photoshop on a server and then remotely run a photoshop script and then upload the generated image somewhere else?
I've used The After Effects Plugin Template by DataClay in the past which offers similar functionality but for video.
Looking forward to hearing your ideas.
Thanks
You can use the Dataclay plugin to handle still image exports out of After Effects. Make a single-frame duration composition in After Effects and rig the layers with the Templater plugin. Then use the PNG Sequence output module to render out a single frame.
From Dataclay's forums:
Exporting
A few extra steps are required to correctly render a project file as a PNG sequence using Templater. By default, a file rendered as a PNG sequence will have the frame number appended to the end of the file name, i.e.:
filename.png00000, filename.png00001, filename.png00002, etc.
In order to designate where in the filename the frame number should be added, we’ll need to use the output column. First, add a column named output to your data source. Next, add a filename with a set of brackets with five # signs to designate where the frame numbering should be added. For example:
filename[#####] would result in filename00001.png
or
[#####]filename would result in 00001filename.png
I have a grails controller to handle uploaded files.
Now the problem is that i dont know by which name user will upload the file.
request.getFile(fileName)
I dont know the 'fileName'.
Please let me know how to handle anonymous file upload. These files are being uploaded from a javascript rich text editor and the name of the file input is comes different with each request.
Please help.
you should dump the parmas and inspect which is varible is holding the filename it might not be the varible filename holding the actual file name. so , if u dont have the file name you would have the file handle to proceeed uploading so do as follow :
1.DUMP parmas like
log.debug("Value of Parmas"+parmas.each{it.value()})
or
println("Value of Parmas"+parmas.each{it.value()})
on your console window or what ever using the browser look for a common name that you will use further to get the file handle usually called 'filename'.
I'm using carrier wave to upload images in rails3,
i want to just check the condition is image available in upload folder or not.
Because in my case suppose image name available in data base but by mistake image deleted from upload folder in that scenario when click on image link getting error .
I think, this can be done using exist?(file_name) method of Ruby File Class. I assume you can get the full path of the file from the database, and pass it to the class method as follows:
File.exist?('full/path/of/the/file')
This will return true if the file exists otherwise false. for reference you can read about File operations here
Carrierwave has a built-in method to do just that. It works whether your storage method is :file or :fog. Looks like this:
picture.data.file.exists?
Some kind of problem I can't resolve…
In some app, a method called on :before_create was prefixing the file's extension with a double-dot (ex. /images/13402/medium/hey-1..jpg)
The problem is fixed for the new ones, but nothing occurs when I apply a reprocess! on the old ones; and I'd like to know if anyone could help about it
Reprocess / refresh only takes your original image and recreates the defined styles in your model class. So if your original image contains a file path with double dots in it, these are also applied to the generated styles. You have to clean up your original files and the stored file paths in your model records.
The only way I know would be to write a little script to modify this. Basically
foreach image
strip out double dots from original file name
rename file
store new file path in model record
end
And then rake paperclip:refresh
When I using "file_field" to upload a file:
The file name can be obtained in the controller:
params[:upload]['datafile'].original_filename
but how can I obtain the size and type of the file?
Use the content_type and size helper functions
params[:upload]['datafile'].content_type
Not sure why you'd want to do that in a controller, but any validation needs to be moved inside your model. Also try using a plugin like Paperclip or SWFUpload to handle uploads, for greater flexibility.
Try these links for a examples Paperclip, Attachment_fu, SWFUpload