I have PDF to ImageField working OK, except for the generated image filename.
- Filefield is set-up to upload PDFs into a directory "newsletter", and the generated file looks like "2012-newsletter-23.pdf", and works perfectly
- However, the generated image (a) is stored in /files and not "newsletter", and (b) the generated filename is "9-0.jpg" (or similar, ie. 14-0.jpg).
I'd like the generated image stored in files/directory, and the generated image filename to match the PDF filename.
Any thoughts?
Comments
Comment #1
dman commentedThe intended behavior is that the file filed directory settings for the image field should be used. You can set both the pdf input folder and the generated jpeg output folder to be the same if that's what you intend.
If that's not working, it's a bit of a bug.
I can't recall the rules for the generated filename, but I would have expected it to be based on the pdf filename also. Not sure why that would be failing.
Comment #2
iantresman commentedI think I'm setting the paths correctly. I'm using:
For the uploaded PDF file (this works fine):
For the destination imagefield
Note added: I'm using a multi-site set-up, with a single Drupal codebase, and each website is in sites/<domain>/files
Comment #3
iantresman commentedIt seems that no matter what I enter in the Imagefield File name field, the generated filename is always of the format 18-0.jpg, 19-0.jpg, 20-0.jpg, etc (ie. the first number increments by one each time). I thought the number might be the nid, but it is not.
I also tried changing the order of the Imagefield CCK fields, to no affect.
So it seems that it may indeed be a bug.
Comment #4
foko commentedHi there. Somebody got any solution for that issue? I got the same problem right now..
And i just need the generated Jpeg to get the same filename like the uploaded PDF-file.
Hope somebody knows the secret.. Thanks! :)
Comment #5
jamesrutherford commentedConfirming this is a bug. Drupal 6.25 cck 3 PDF to imagefield 6.x-2.0+7-dev. Neither the imagefield or the filefield use the name and path settings I specified.
Comment #6
dman commentedYeah. The 7.x-2.x changed the internal structure to use its own version of a file field instead of inheriting and extending the core one. This means that a lot of utilities that hang off file field (like filefield_paths) were incompatible with it.
This looks unsustainable, and I'd rather have some form of token support and compatibility with other modules going on, so I'm trying to fix that back to like it was in D6.
It's happening in a new branch
Comment #7
iantresman commentedMany thanks, looking forward to a new 6.x-2.x-dev version to try out.
Comment #8
iantresman commentedJust wondering whether we are any closer to a fix or workaround
Comment #9
dman commentedClosing 6.x issues as unsupported. (sorry?)